i wonder why my code have an error.. this my code and i will highlight the error
.. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim connection As New SqlClient.SqlConnection
Dim command As New SqlClient.SqlCommand
Dim adapter As New SqlClient.SqlDataAdapter
Dim dataset As New DataSet
connection.ConnectionString = ("Data Source=CUBED-DESKTOP05;Initial Catalog=Biometrics;Integrated Security=True")
connection.Open()
command.CommandText = " SELECT * FROM (admin) WHERE username= '" & TextBox1.Text & "' AND password= '" & TextBox2.Text & "';"
command.Connection = connection
adapter.SelectCommand = command
' this part is where the error made
adapter.Fill(dataset, "0")
Dim count = dataset.Tables(0).Rows.Count
If count > 0 Then
MsgBox("Welcome to Cubed Technologies", MsgBoxStyle.OkOnly)
Form2.Show()
Me.Close()
Else
MsgBox("Incorrect Login please Check your Username and Password")
TextBox1.Clear()
TextBox2.Clear()
Me.TextBox1.Focus()
End If
End Sub