Dim UserName As String = e.Form.Controls("UserName").Value
Dim db = HySql.DataBaseFactory.CreateDatabase("YF123")
If UserName = "" Then
Messagebox.show("请选择用户!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
Return
End If
'ACCESS
Dim Sql = "Selec-t * From Users Where Name = '" & UserName & "'"
Dim dt As system.data.DataTable = db.ExecuteDataSet(Sq-l).Tables(0)
'Msgbox(dt.Rows.Count)
If dt.DataRows.Count = 0 Then
Messagebox.show("此用户不存在!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
Return
End If
Dim dr As DataRow
dr = dt.DataRows(0)
If e.Form.Controls("PassWord").Value = dr("Password") Then
_UserName = UserName
_UserGroup = dr("Group")
_UserRole = dr("Role")
e.Form.Close
Else
Messagebox.show("密码错误!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
End If
报错:红代码不是system.data.DataTable,如何解决?