Rss & SiteMap

Foxtable(狐表) http://www.foxtable.com

新一代数据库软件,完美融合Access、Foxpro、Excel、vb.net之优势,人人都能掌握的快速软件开发工具!
共3 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:登录窗口代码

1楼
chengzhang 发表于:2011/9/14 13:54:00

Dim uName As String = e.Form.Controls("txtName").Value
Dim pwd As String = e.Form.Controls("txtpwd").value
Dim cmd As New SQLCommand
Dim dt As DataTable
Dim dr As DataRow
cmd.C
If uName = "" Then
    Messagebox.show("请输入用户名!","提示",MessageBoxButtons.OK,MessageBoxIcon.Warning)
    Return
Else If pwd = ""
    Messagebox.show("密码不能为空!","提示",MessageBoxButtons.OK,MessageBoxIcon.Warning)
    Return
End If
cmd.CommandText = "Select * From {userInfo}  Where [userID] = '" & uName.trim() & "'"
dt = cmd.ExecuteReader

If dt Is Nothing Then  数据查询出来结果,但是却不往下面执行
    dr = dt.DataRows(1)
    If e.Form.Controls("txtpwd").Value = dr("userPwd") Then
        _UserName = uName
        _UserGroup = dr("userDES")
        MessageBox.Show("登录成功!" & 1,"提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
    Else
        Messagebox.show("密码错误!" ,"提示",MessageBoxButtons.OK,MessageBoxIcon.Warning)
    End If
Else
    MessageBox.Show("用户名或密码错误,请重新输入!","提示" ,MessageBoxButtons.OK,MessageBoxIcon.Warning)     每次执行的是这句
   ' e.Form.Controls("txtpwd").value = ""
End If

 

开始做测试的时候,执行还正确,可是后来在项目打开后,就不能正常使用了,这是怎么回事!

 

2楼
狐狸爸爸 发表于:2011/9/14 14:27:00
If dt IsNot Nothing Then 数据查询出来结果,但是却不往下面执行
3楼
chengzhang 发表于:2011/9/14 15:11:00

哦~谢谢!我都没留意呢,劳烦了!

共3 条记录, 每页显示 10 条, 页签: [1]

Copyright © 2000 - 2018 foxtable.com Tel: 4000-810-820 粤ICP备11091905号

Powered By Dvbbs Version 8.3.0
Processed in .01563 s, 2 queries.