473,320 Members | 1,887 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How put a Dataset in a Datagridview

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
1 1505
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Robert Koller | last post by:
Hello i have this problem: In a DataGridView the user work with data from a DataSet. on Start the row index from datagridview is the same as the row index from the dataset. Also: ...
2
by: bob | last post by:
Can anyone tell me the best way to update a dataset while it is being edited/viewed in the DataGridView control? Is this something that should be inserted into one of the grid's events? or should...
2
by: kristian | last post by:
Hi all I have a datagridview, and I want it to show and enable editing of a table in my mysql database. I get the results from the sql-query into the dataset, and when I view the dataset in...
0
by: David Mayerovitch | last post by:
As an exercise in learning Visual Basic 2005, I am putting together a simple XML editor. I place on the form the objects DataGridView1 and DataSet1. ' Read an XML file into DataSet1:...
1
by: JD | last post by:
I have a DataGridView with a DataSet as DataSource. The user can update the contents of the DataGridView, and then click on a Save button to save the data to an XML file. When they click on...
0
by: twigboy | last post by:
Hi everyone, I have a strongly typed dataset, with my main form having a datagridview that is binded to an access database. The main form has three buttons one to create a new entry in the...
0
JordanMartz
by: JordanMartz | last post by:
''' <summary> ''' Populates the DataGridView ''' </summary> Private Sub PopulateDataGridView() ' Set the column header names. userAccessGrid.ColumnCount = 5 ...
0
by: Dennis Francek | last post by:
Hello I have populated a treeview from my dataset and by clicking in the treeview i want to get the corresponding table shown in a datagridview. Ive managed this by looking at each DataRow and...
5
by: jandeerit | last post by:
Hi, I want to store the values from the datagridview into a dataset and use the dataset as a method parameter.. However, the datagridview is not bind to any source.. I tried something like the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.