Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: WPF MySQL VB.NET
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:
 
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 29-Jun-12 10:06am
aldiano470

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Hi,
 
Instead of using a dataset, did you try using datatable?
 
Regards,
Darshan.
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 328
1 Gihan Liyanage 292
2 Sergey Alexandrovich Kryukov 275
3 ClimerChinna 222
4 Abhinav S 187
0 Sergey Alexandrovich Kryukov 8,213
1 OriginalGriff 7,089
2 CPallini 2,598
3 Richard MacCutchan 1,925
4 Abhinav S 1,778


Advertise | Privacy | Mobile
Web03 | 2.8.140826.1 | Last Updated 11 Jul 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100