level 1
在香水河养龙猫的鹦鹉
楼主
Private Sub login_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles login_Button.Click
Dim bookCnn As New SqlConnection("Data Source=(local); Initial Catalog=bookSystem;Integrated Security=True")
Dim cmd As New SqlCommand("select * from administrator_Table", bookCnn)
bookCnn.Open()
Dim reader As SqlDataReader = cmd.ExecuteReader
While (reader.Read)
If user_TextBox.Text = Trim(reader("name")) And password_TextBox.Text = Trim(reader("password")) Then
Me.Hide()
welcome.Show()
Else
user_TextBox.Text = Trim(reader("password"))
End If
End While
例如那个表的第一行是 a 密码 123,第二行 b 321 ,我输入 a 123 ,执行了show welcome窗口,但是输入b 321,执行的确是else 那个语句,如何实现 输入 b 321 甚至 c 111 之类的其他行都能够正确执行show呢
我现在第一行的能够正确执行,但是第二行第三行都是执行的是else 那个语句,求好人帮忙,感激不尽!这究竟是为什么?
2012年12月08日 07点12分
1
Dim bookCnn As New SqlConnection("Data Source=(local); Initial Catalog=bookSystem;Integrated Security=True")
Dim cmd As New SqlCommand("select * from administrator_Table", bookCnn)
bookCnn.Open()
Dim reader As SqlDataReader = cmd.ExecuteReader
While (reader.Read)
If user_TextBox.Text = Trim(reader("name")) And password_TextBox.Text = Trim(reader("password")) Then
Me.Hide()
welcome.Show()
Else
user_TextBox.Text = Trim(reader("password"))
End If
End While
例如那个表的第一行是 a 密码 123,第二行 b 321 ,我输入 a 123 ,执行了show welcome窗口,但是输入b 321,执行的确是else 那个语句,如何实现 输入 b 321 甚至 c 111 之类的其他行都能够正确执行show呢
我现在第一行的能够正确执行,但是第二行第三行都是执行的是else 那个语句,求好人帮忙,感激不尽!这究竟是为什么?