🔒 Closed Admin Login, Register and Dashboard with Mysql Database

Status
Not open for further replies.
Sir pwede po magpatulong paano ko po ipapasok dito yung condition na kapag equal sa admin or cs ang value ng combobox1 mag proceed po.



Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
If (String.IsNullOrEmpty(txtuser.Text) = True Or String.IsNullOrEmpty(txtpass.Text) = True) Then
MessageBox.Show("Please enter username and password")
Else
Dim con As SqlConnection = New SqlConnection("Data Source=DESKTOP-DILIAA0;Initial Catalog=mydataBase;Integrated Security=True")
con.Open()
Dim cmd As SqlCommand = New SqlCommand("Select * from TBLUSER where USERNAME='" + txtuser.Text + "' , PASSWORD='" + txtpass.Text + "'", con)
Dim sda As SqlDataAdapter = New SqlDataAdapter(cmd)
Dim dt As DataTable = New DataTable()
sda.Fill(dt)
con.Close()

If (dt.Rows.Count > 0) Then
MessageBox.Show("Login Successful")
KANGOFORM1.Show()
Me.Hide()
Else
MessageBox.Show("Incorrect Username or Password")
txtuser.Text = ""
txtpass.Text = ""
End If
End If
End Sub

1625011265012.png
 
Status
Not open for further replies.

About this Thread

  • 20
    Replies
  • 1K
    Views
  • 9
    Participants
Last reply from:
PHC-Xes

Trending Topics

Online now

Members online
1,065
Guests online
2,094
Total visitors
3,159

Forum statistics

Threads
2,295,027
Posts
29,094,924
Members
1,206,662
Latest member
h3h3h3
Back
Top