Now, i have Set up the Connection to MySQL,and i have this Layout:
|ID|Class|Name|Password|
The Names are ALL shown in Combobox2.But i have a Combobox1 with Numbers.Now if i select 1, i want only the Users with Class 1 to show in my Combobox2,when i Select 2, only Class 2 and so on. Also, i want the Programm to check the Password. What could i use to make this all happen? I also have a DataGridView if it helps. My code:
Dim conn As New MySqlConnection
Dim myConnectionString As String
myConnectionString = "server=127.0.0.1;uid=root;pwd=banana;database=kinder; "
conn.ConnectionString = myConnectionString
Try
conn.Open()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
Dim com As String = "Select * from kind"
Dim Adpt As New MySqlDataAdapter(com, conn)
Dim ds As New DataSet()
Adpt.Fill(ds, "kind")
DataGridView1.DataSource = ds.Tables(0)
Dim strSQL As String = "SELECT name FROM kind"
With ComboBox2
.DataSource = ds.Tables("kind")
.DisplayMember = "name"
.SelectedIndex = 0
End With
Thx in Future