Click here to Skip to main content
12,246,601 members (52,390 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: VB 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 11: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
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160426.1 | Last Updated 11 Jul 2012
Copyright © CodeProject, 1999-2016
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