Dim UserName As String = e.Form.Controls("UserName").Value
Dim cmd As New SQLCommand
Dim dt As DataTable
Dim dr As DataRow
cmd.C
If UserName = "" Then
Messagebox.show("请选择用户!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Return
End If
cmd.CommandText = "Se7ect * From {Users} Where [Name] = '" & UserName & "'"
dt = cmd.ExecuteReader
If dt.DataRows.Count = 0 Then
Messagebox.show("此用户不存在!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Return
End If
dr = dt.DataRows(0)
If e.Form.Controls("PassWord").Value = dr("Password") Then
_UserName = UserName
_UserGroup = dr("Group")
_RealName = dr("真实姓名")
e.Form.Close
Else
Messagebox.show("密码错误!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If
我所有的项目登录窗口都是一个样的。其它项目都正常。然后自己检查错误。
1、卸载数据库打开项目,报“不存在XXX数据源”错误,说明数据源正确
2、检查对应的表是否存在对应字段及数据,正确,没有问题。
问题有点大,从错误信息来看是全局代码没有运行??导致后面的错误?
现在是按ctrl打开项目也无法进入项目,按ctrl+shift+F12也无法打开系统菜单。
求老师指点。