Click here to Skip to main content
11,502,547 members (37,455 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: WPF MySQL VB.NET
i'm getting stuck with my code...
how to show query from mysql to wpf datagrid with
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
        dataGridView.ItemsSource = data
    End Sub

need your help!
Posted 29-Jun-12 10:06am

1 solution

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

Solution 1


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


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

Advertise | Privacy | Mobile
Web04 | 2.8.150520.1 | Last Updated 11 Jul 2012
Copyright © CodeProject, 1999-2015
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