继续学习后作了一些我认为该修改的 传上来 但是测试时users(用户信息表)还是没有记录注册信息
Dim UserGroup As String = e.Form.Controls("UserGroup").Value
Dim zxx As String = e.Form.Controls("zxx").Value
Dim xx As String = e.Form.Controls("xx").Value
Dim UserName As String = e.Form.Controls("UserName").Value
Dim UserIsRole As String = e.Form.Controls("js").Value
Dim PassWord As String = e.Form.Controls("PassWord").Value
Dim dwdh As String = e.Form.Controls("dwdh").Value
Dim grdh As String = e.Form.Controls("grdh").Value
Dim emile As String = e.Form.Controls("emile").Value
Dim qq As String = e.Form.Controls("qq").Value
Dim cmd As New SQLCommand
cmd.C
If "UserName" = "" OrElse "UserGroup" = "" Then
Messagebox.show("请输入用户名和用户分组!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Return
End If
cmd.CommandText = "Select Count(*) From {Users} Where Name = '" & "UserName" & "'" (列名同步修改)
If cmd.ExecuteScalar > 0 Then
Messagebox.show("增加用户失败,已经能存在同名用户!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Return
End If
cmd.CommandText = "Insert Into {Users} ([Group],[中小学],[学校],[Name],[IsRole],[单位电话],[个人电话],[电子邮箱],[QQ号码],[密码]) Values ('"
cmd.CommandText = cmd.CommandText & UserGroup & "','" & zxx & "','" & xx & "','" & UserName & "','" & UserIsRole & "','" & dwdh & "','" & grdh & "', '" & emile & "','" & qq & "','" & PassWord &"')"
e.Form.Close()
[此贴子已经被作者于2013-3-18 16:18:27编辑过]