读书人

登录代码调试有关问题

发布时间: 2012-01-05 22:36:54 作者: rapoo

登录代码调试问题
未处理的“System.MissingMemberException”类型的异常出现在 microsoft.visualbasic.dll 中。

其他信息: 未找到类型“String”的公共成员“Value”。


Dim strSQL As String
Dim cn As New SqlClient.SqlConnection
Dim rs As New DataSet
cn.ConnectionString = "server=COMPUTER;Database=NEW;uid=sa;Password=; "
cn.Open()
strSQL = "select 密码 from 登录 where 用户名= ' " & 用户登录_Renamed.Text & " ' "
Dim da As New SqlClient.SqlDataAdapter(strSQL, cn)
Dim count As Int32 = da.Fill(rs)
If count = 0 Then
MsgBox( "用户名不正确 ")
Else
If rs.Tables(0).Rows(0)(0).Value = Text1.Text Then
MsgBox( "登录成功 ")
Else
MsgBox( "密码错误 ")
End If
End If


调试后
If rs.Tables(0).Rows(0)(0).Value = Text1.Text Then

这行是黄字显示




[解决办法]
rs.Tables(0).Rows(0).Item(0).ToString

读书人网 >VB Dotnet

热点推荐