Hello
I write some code that opens a database then list's the tables then if you click on the table it will list the columns in the table along with the
data i have every thing working but all the data lists in the first column if the list view as seen in the image bellow.
Thanks so much for your help
Code that gets and lists data/columns :
Image
![help.jpg help.jpg](https://vbdotnetforums.com/data/attachments/2/2345-e4682498cb07120471a95463ba25d49a.jpg)
I write some code that opens a database then list's the tables then if you click on the table it will list the columns in the table along with the
data i have every thing working but all the data lists in the first column if the list view as seen in the image bellow.
Thanks so much for your help
Code that gets and lists data/columns :
VB.NET:
[LEFT][COLOR=#CCCCCC][FONT=Monaco]public Sub list_data(ByRef Table As String, ByRef loction As String)[/FONT][/COLOR]
[COLOR=#CCCCCC][FONT=Monaco] 'ListView1.Columns.Clear()[/FONT][/COLOR]
[COLOR=#CCCCCC][FONT=Monaco] Dim connection As New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & loction)[/FONT][/COLOR]
[COLOR=#CCCCCC][FONT=Monaco] connection.Open()[/FONT][/COLOR]
[COLOR=#CCCCCC][FONT=Monaco] Dim da As New OleDb.OleDbDataAdapter("select * from " & Table, connection)[/FONT][/COLOR]
[COLOR=#CCCCCC][FONT=Monaco] Dim ds As New DataSet[/FONT][/COLOR]
[COLOR=#CCCCCC][FONT=Monaco] da.Fill(ds)[/FONT][/COLOR]
[COLOR=#CCCCCC][FONT=Monaco] For a = 0 To ListView1.Columns.Count - 1[/FONT][/COLOR]
[COLOR=#CCCCCC][FONT=Monaco] For i = 0 To ds.Tables(0).Rows.Count - 1[/FONT][/COLOR]
[COLOR=#CCCCCC][FONT=Monaco] ListView1.Columns(a).ListView.Items.Add(ds.Tables(0).Rows(i)(a))[/FONT][/COLOR]
[COLOR=#CCCCCC][FONT=Monaco] Next i[/FONT][/COLOR]
[COLOR=#CCCCCC][FONT=Monaco] Next[/FONT][/COLOR]
[COLOR=#CCCCCC][FONT=Monaco] End Sub[/FONT][/COLOR][/LEFT]
Image
![help.jpg help.jpg](https://vbdotnetforums.com/data/attachments/2/2345-e4682498cb07120471a95463ba25d49a.jpg)