我有一个 SP,我试图从中返回 2 个结果集,在我的 .cs 文件中,我正在尝试这样的事情:
dr = cmd.ExecuteReader();
while (dr.Read())
{
RegistrationDetails regDetails = new RegistrationDetails()
{
FName = dr["FName"].ToString(),
LName = dr["LName"].ToString(),
MName = dr["MName"].ToString(),
EntityName = dr["EntityName"].ToString(),// in 2nd result set
Percentage = dr["Percentage"].ToString()// in 2nd result set
};
}
但是我得到一个:
错误:IndexOutOfRange {"EntityName"}