根据教程做的自定义用户管理系统,本地使用正常,现在我把数据源定向称SQL网络数据源了,现在是不是不用使用用户.MBD文件了,直接在登录时,确定按钮改成:
Dim UserName As
String = e.Form.Controls("UserName").Value
Dim cmd As New
SQLCommand
Dim dt As
DataTable
Dim dr
As
DataRow
cmd.ConnectionName = "weike" (weike这是数据库的名字)
If UserName = "" Then
Messagebox.show("请选择用户!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Return
End
If
cmd.CommandText = "Select * From {Users} Where [Name] = '" &
UserName & "'"
dt = cmd.ExecuteReader
dr = dt.DataRows(0)
........
是不是这样的?
我已经把Users 的表定向到weike,里了