🔒 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

Online now

Members online
612
Guests online
1,911
Total visitors
2,523

Forum statistics

Threads
2,276,010
Posts
28,967,034
Members
1,232,043
Latest member
djodhiubiu
Back
Top