本文介绍了指数数组的边界之外. ?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
cmd = new SqlCommand("select RefferBy from UsersIncome where UserName='" + Label1.Text + "'", con);
dtr = cmd.ExecuteReader();
if (dtr.Read())
{
Label2.Text = dtr[0].ToString();
Label3.Text = dtr[1].ToString();
Label4.Text = dtr[2].ToString();
Label5.Text = dtr[3].ToString();
}
它表明Index不在数组的范围内,为什么??????
it is showing Index was outside the bounds of the array why ?????
推荐答案
cmd = new SqlCommand("select RefferBy from UsersIncome where UserName='" + Label1.Text + "'", con);
dtr = cmd.ExecuteReader();
if (dtr.Read())
{
Label2.Text = dtr[0].ToString();
/*Label3.Text = dtr[1].ToString();
Label4.Text = dtr[2].ToString();
Label5.Text = dtr[3].ToString();*/
}
这篇关于指数数组的边界之外. ?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!