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,如何解决?
没搞明白,请老师在实例纠正,谢谢
[此贴子已经被作者于2024/6/17 14:33:45编辑过]
If dt.Rows.Count = 0 Then
参考4楼改,DataRows是foxtable的用法。net是rows。.net的东西这里没有办法提供详细的技术支持,如果都看不懂的,建议还是不要用
提示很明显啊
Dim dr As system.data.DataRow
dr = dt.Rows(0)