Public User As String
Public password As String
Dim conn As New SqlConnection("Server=.;" & _
"Database=ViBook; " & _
"Integrated Security=SSPI ")
Dim comm As New SqlCommand
Dim ds As New DataSet
Dim da As New SqlDataAdapter
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
User = TextBox1.Text
password = TextBox2.Text
Dim str As String
str = "select * from 管理员信息 where 姓名='" & User & "' and 密码='" & password & "'"
comm.Connection = conn '这几处我不懂,希望朋友们帮忙解释下,谢谢
comm.CommandType = CommandType.Text '这几处我不懂,希望朋友们帮忙解释下,谢谢
comm.CommandText = str '这几处我不懂,希望朋友们帮忙解释下,谢谢
da.SelectCommand = comm '这几处我不懂,希望朋友们帮忙解释下,谢谢
还有下面这个
Private Sub TextBox2_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox2.KeyPress '这个触发事件是什么意思
If e.KeyChar = Microsoft.VisualBasic.ChrW(13) _
And TextBox2.Text <> "" Then '这个地方也不明白
Me.Button1_Click(Nothing, Nothing) '这个地方也不明白
End If
End Sub
新手请教不理解的代码!