新问题:2、在未登录的情况下怎么往外部数据源里面增加数据?
Dim UserName As String = e.Form.Controls("TextBox5").Value
Dim UserGroup As String = e.Form.Controls("TextBox1").Value
Dim Userxm As String = e.Form.Controls("TextBox2").Value
Dim PassWord As String = e.Form.Controls("TextBox4").Value
Dim dr As DataRow
If UserName = "" OrElse UserGroup = "" Then
Messagebox.show("请输入用户名和用户分组!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Return
End If
If _UserTable.SQLFind("[Name] = '" & UserName & "'") IsNot Nothing Then
Messagebox.show("增加用户失败,已经能存在同名用户!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Return
End If
dr = _UserTable.AddNew()
dr("Name") = UserName
dr("Group") = UserGroup
dr("xm") = Userxm
dr("Password") = PassWord
_UserTable.Save()
e.Form.Close()
下面这节不需要,如何把上面dr行的内容保存进外部数据源user?
If Forms("用户管理").Opened Then
With Forms("用户管理").Controls("ListBox1")
.Items.Add(UserName)
.SelectedIndex = .Items.Count -1
End With
End If