菜鸟求助!!编了个注册器有问题!
我编了个注册器 代码如下:Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
Me.Text = "正在验证......"
Me.Cursor = System.Windows.Forms.Cursors.WaitCursor
Dim comstr As String
Dim mydataset As New DataSet
comstr = "select 密码 from 用户 where 用户名 = ' Trim(textbox1.Text) '"
mydataset.Clear()
Dim adapter As New sqldataadapter(comstr, SqlConnection1)
adapter.fill(mydataset, "table1")
If mydataset.Tables("table1").Rows(0).Item(0) = Trim(TextBox1.Text) Then
userinf(0) = Trim(TextBox1.Text)
Me.Hide()
Else
MsgBox("密码错误!")
TextBox2.Text = ""
Me.Text = ""
Me.Cursor = System.Windows.Forms.Cursors.Arrow
TextBox2.Focus()
End If
Catch ex As Exception
MsgBox("用户不存在!", MsgBoxStyle.OKOnly, "提示")
TextBox1.Text = ""
TextBox1.Text = ""
Me.Text = ""
Me.Cursor = System.Windows.Forms.Cursors.Arrow
End Try
End Sub
我在SQL中新建名为“注册器”数据库,在其中新建表“用户”,字符段“用户名,密码”
可运行有问题