By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,474 Members | 1,273 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,474 IT Pros & Developers. It's quick & easy.

How put a Dataset in a Datagridview

P: n/a
Hi, I'm newbye in that theme. I would like put the data of a dBase in a
DataGridView, why make that?.

I'm open my database with this instructions:
'----------------
Dim Tabla As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data
Source=" _
& Folder & ";Extended Properties=dBASE IV")
Tabla.Open()
Folder = Path.GetFileNameWithoutExtension(ruta) 'Name of the file

Dim Comando As New OleDbCommand("Select * From " & Folder, Tabla) 'Select
all values in the dBase
Dim da1 As New OleDbDataAdapter(Comando)
Dim DataSet As New Data.DataSet

da1.Fill(DataSet) 'I put all the info in the dataset.

Tabla.Close()
'----------------

Now I need put all that data in a Datagridview, and I donīt find an example
about how make that; My datagridview is clear, don't have any columns, I
would like add diferent dBase and make columns and rows for each database.

Thanks in advance for any help.

Freddy Coal
Oct 26 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Oct 26, 8:53 am, "Freddy Coal" <freddyc...@gmaiwithoutspan.com>
wrote:
Hi, I'm newbye in that theme. I would like put the data of a dBase in a
DataGridView, why make that?.

I'm open my database with this instructions:
'----------------
Dim Tabla As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data
Source=" _
& Folder & ";Extended Properties=dBASE IV")
Tabla.Open()
Folder = Path.GetFileNameWithoutExtension(ruta) 'Name of the file

Dim Comando As New OleDbCommand("Select * From " & Folder, Tabla) 'Select
all values in the dBase
Dim da1 As New OleDbDataAdapter(Comando)
Dim DataSet As New Data.DataSet

da1.Fill(DataSet) 'I put all the info in the dataset.

Tabla.Close()
'----------------

Now I need put all that data in a Datagridview, and I donīt find an example
about how make that; My datagridview is clear, don't have any columns, I
would like add diferent dBase and make columns and rows for each database.

Thanks in advance for any help.

Freddy Coal
MyDataGridView.DataSource = DataSet.Tables("TheTableToDisplay")

--
Tom Shelton

Oct 26 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.