Foxtable(狐表)用户栏目专家坐堂 → 救命,弄了几天


  共有3705人关注过本帖平板打印复制链接

主题:救命,弄了几天

帅哥哟,离线,有人找我吗?
ljtao888
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:67 积分:622 威望:0 精华:0 注册:2012/7/30 15:32:00
救命,弄了几天  发帖心情 Post By:2013/9/9 11:12:00 [只看该作者]

代码测试没问题,可登录点确定按钮就有问题,是外源

代码如下:

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

图片点击可在新窗口打开查看此主题相关图片如下:qq图片20130909110606.jpg
图片点击可在新窗口打开查看
[此贴子已经被作者于2013-9-9 11:35:17编辑过]

 回到顶部
总数 15 1 2 下一页