If Vars("用户管理") = "增加用户" Then
Dim username As WinForm.TextBox = e.Form.Controls("用户名").value
Dim password As WinForm.TextBox = e.Form.Controls("密码").value
Dim usergroup As WinForm.ComboBox = e.Form.Controls("属性").value
Dim cmd As New SQLCommand
cmd.C
If username = "" OrElse usergroup = "" Then
Messagebox.show("请输入用户名和用户分组!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Return
End If
cmd.CommandText = "Insert Into {用户表} ([用户名],[属性],[密码]) Values ('"
cmd.CommandText = cmd.CommandText & username & "','" & usergroup & "','" & password & "')"
If cmd.ExecuteNonQuery = 1 Then '返回1表示增加成功
With Forms("用户管理").Controls("ListBox1")
.Items.Add(username)
.SelectedIndex = .Items.Count -1
End With
Else
Messagebox.show("增加用户失败, 可能存在同名用户!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If
End If
代码保存时显示编译错误:重载决策失败,原因是没有可访问的“=“可以调用这些参数,错误代码是标黄代码。