我收到以下错误:
index was outside the bounds of the array
使用此代码时:
con.Open()
qur = "select Username,password from registration where Username='" + TextBox1.Text + "'"
cmd = New SqlCommand(qur, con)
dr = cmd.ExecuteReader()
If dr.HasRows() Then
dr.Read()
Session("us1") = dr.GetValue(11).ToString()
Session("ps1") = dr.GetValue(12).ToString()
If Session("us1") = TextBox1.Text And Session("ps1") = TextBox2.Text Then
Response.Redirect("APP.aspx")
End If
End If
End Sub
有人可以指出哪里/为什么出错了吗?