[RESOLVED] [MS Access][VB.Net 2008] No Error but no values from a query
Hi,
I have looked very long time in google and in this forum but maybe because of the wrong keywords I cant find any solution.
Code:
Dim CN As OleDb.OleDbConnection
Dim DS As DataSet
Dim DA As OleDb.OleDbDataAdapter
Private Sub Bağlan(Optional ByRef Path As String = "Ürün Hesap Veritabanı.accdb")
CN = New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & Path & ";Persist Security Info=False;")
CN.Open()
DA = New OleDb.OleDbDataAdapter("SELECT * FROM Products", CN)
DS = New DataSet
DA.Fill(DS, "Products")
DGW.DataSource = DS
End Sub
In the DGW (datagridview) there no columns, rows or cells. But this table has a few rows. How can I solve this problem?:confused:
Thanks guys...
Re: [MS Access][VB.Net 2008] No Error but no values from a query
You need to specify data table as the source:
Code:
DGW.DataSource = DS.Tables(0) 'or provide valid table name instead of index
Re: [MS Access][VB.Net 2008] No Error but no values from a query