代码测试没问题,可登录点确定按钮就有问题,是外源
代码如下:
Dim UserName As String = e.Form.Controls("UserName").Value
Dim cmd As New SQLCommand
Dim dt As DataTable
Dim dr As DataRow
cmd.ConnectionName = "MYERP"
If UserName = "" Then
Messagebox.show("请选择用户!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Return
End If
cmd.CommandText = "Select * 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")
MessageBox.show(1)
e.Form.Close
Else
Messagebox.show("密码错误!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If
![dvubb 图片点击可在新窗口打开查看](skins/default/filetype/jpg.gif)
此主题相关图片如下:qq图片20130909110606.jpg
[此贴子已经被作者于2013-9-9 11:35:17编辑过]