Я пытаюсь отфильтровать данные в моих Gridviews, но данные не отображаются, вы можете помочь? Это код:
Sub launchLapangan()
Call Connection()
ComboBox1.Items.Clear()
Cmd = New OdbcCommand("Select * from lapangan", Conn)
Rd = Cmd.ExecuteReader
Do While Rd.Read
ComboBox1.Items.Add(Rd.Item(0))
Loop
End Sub
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
Call Connection()
'(This for choose the filter from table lapangan)'
Cmd = New OdbcCommand("Select * from lapangan where id_lapangan ='" & ComboBox1.Text & "'", Conn)
Rd = Cmd.ExecuteReader
Rd.Read()
If Rd.HasRows Then
LabelHarga.Text = Rd!harga_lapangan
LabelJenis.Text = Rd!jenis_rumput
LabelDP.Text = Rd!DP
'(This the error/data doesnt appear)'
'(then i will show the filter using foreign key id_lapangan which exist in table detail_reservasi)'
Da = New OdbcDataAdapter("Select * from detail_reservasi", Conn)
Ds = New DataSet
Da.Fill(Ds, "detail_reservasi")
DataGridView1.DataSource = Ds.Tables("detail_reservasi")
DataGridView1.ReadOnly = True
End If
End Sub
Можете ли вы помочь мне? я использую Mysql базу данных в XAMPP