Advertisement
Guest User

Untitled

a guest
Apr 4th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  2. Dim conn As New MySqlConnection
  3. conn.ConnectionString = ("server=wish-pc;userid=root;password=root;Initial Catalog=SSdatabase;Integrated Security=True")
  4. Dim cmd As New MySqlCommand
  5. Dim dr As MySqlDataReader
  6.  
  7. conn.Open()
  8. cmd.Connection = conn
  9. cmd.CommandText = ("select * from stable where username='" & TextBox1.Text & "'and password='" & TextBox2.Text & "'")
  10. dr = cmd.ExecuteReader
  11. If dr.HasRows Then
  12. Me.Hide()
  13. Form2.Show()
  14. Else
  15. MessageBox.Show("username and password are not correct")
  16.  
  17. End If
  18.  
  19. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement