Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click
- Dim a As New SqlCommand("select * from log_in where username = '" & UsernameTextBox.Text & "' and password = '" & PasswordTextBox.Text & "'", Module1.koneksi)
- Dim dr As SqlDataReader = a.ExecuteReader
- dr.Read()
- If dr.HasRows = True Then
- If dr.Item(2) = 2 Then
- MainMenu.Button1.Visible = False
- MainMenu.Button2.Visible = False
- MainMenu.Show()
- Me.Close()
- ElseIf dr.Item(2) = 1 Then
- MainMenu.Button3.Visible = False
- MainMenu.Show()
- Me.Close()
- Else
- MainMenu.Show()
- Me.Close()
- End If
- Else
- MsgBox("username dan password tidak terdaftar")
- End If
- End Sub
- Private Sub Cancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel.Click
- Me.Close()
- End Sub
- Private Sub LoginForm1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- Try
- Module1.koneksi.Close()
- Catch ex As Exception
- MsgBox("database setting error")
- Module1.koneksi.Close()
- DBset.Show()
- Me.Close()
- End Try
- End Sub
Add Comment
Please, Sign In to add comment