Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Call Connection()
- Dim myAdapter As New MySqlDataAdapter
- Dim sqlQuery = "SELECT * FROM tb_login WHERE username='" + txtUser.Text + "' AND password='" + txtPass.Text + "'"
- Dim myCommand As New MySqlCommand
- myCommand.Connection = conn
- myCommand.CommandText = sqlQuery
- myAdapter.SelectCommand = myCommand
- Dim myData As MySqlDataReader
- myData = myCommand.ExecuteReader()
- If txtUser.Text = "" Or txtPass.Text = "" Then
- MsgBox("Isi Terlebih Dahulu Username Dan Password", MsgBoxStyle.Exclamation, "Warning!")
- Else
- If myData.HasRows = 0 Then
- MsgBox("Password Anda Salah", MsgBoxStyle.Critical, "Error!")
- Else
- MenuUtama.Show()
- Me.Hide()
- End If
- End If
- txtUser.Text = ""
- txtPass.Text = ""
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement