@
Raydenman
this is my code
Imports System.Data.SqlClient
Imports MySql.Data.MySqlClient
Dim MySqlConnection As MySqlConnection
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
MySqlConnection = New MySqlConnection
MySqlConnection.ConnectionString = "server=*******;port=******; user id=******; password=******; database=******"
MySqlConnection.Open()
Dim Myadapter As New MySqlDataAdapter
Dim sqlquary = "SELECT * From Users WHERE username='" & TextBox1.Text & "'AND password='" & TextBox2.Text & "';"
Dim command As New MySqlCommand
command.Connection = MySqlConnection
command.CommandText = sqlquary
Myadapter.SelectCommand = command
Dim Mydata As MySqlDataReader
Mydata = command.ExecuteReader
If Mydata.HasRows = 0 Then
MsgBox("Incorrect username or password.")
Else
Form1.Show()
Me.Hide()
End If
End Sub