Dim dt As DataTable
Dim cmd As New SQLCommand
cmd.C
cmd.Command Text ="S elect 系统批准,公司批准 From {Users} Where Name = '" & Name & "' and pass = '" & pass & "'"
dt = cmd.Execute Reader
For Each dr As DataRow In dt.DataRows
if dr isnot notthing then
if val(dr("系统批准")) = 0 orelse val(dr("公司批准")) = 0 then
Messagebox.Show("未授权","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
end if
exit for
else
Messagebox.Show("用户或密码错误","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
end if
Next
[此贴子已经被作者于2016/5/6 23:14:52编辑过]