Click here to Skip to main content
15,880,392 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,
i'm getting stuck with my code...
how to show query from mysql to wpf datagrid with vb.net?
i'm using dataset..
here's my code:

VB
Private Sub showDefaultGrid()
        'there's no problem in db connection
        konek(server, user, pass, db)
        Dim sewa As New MySql.Data.MySqlClient.MySqlCommand
        sewa.CommandType = CommandType.Text
        sewa.CommandText = "select * from data_sewa, pelanggan, petugas, kendaraan where data_sewa.id_pelanggan=pelanggan.id_pelanggan and data_sewa.id_kendaraan=kendaraan.id_kendaraan and data_sewa.id_petugas=petugas.id_petugas"
        sewa.Connection = conn
        Dim data As New MySql.Data.MySqlClient.MySqlDataAdapter(sewa)
        Dim table As New DataSet()
        'i'm getting stuck after this
        data.Fill(table)
        dataGridView.ItemsSource = data

    End Sub


need your help!
Posted

1 solution

Hi,

Instead of using a dataset, did you try using datatable?

Regards,
Darshan.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900