Below, I is is the code I am using to connect to our ms sql2000 db. It will fill a list box with the tables there. How do I expand that to print out the column names of one of the tables? Please help with code examples.
I am wanting to use DataColumn, I think, but do not know how. A good start would be to fill a 2nd listbox with the column names from the one in listbox.item(0) for me to learn.
Dim connection As SqlConnection
connection = New SqlConnection("Data Source=CUBSQL;Initial Catalog=CompanyA;.......)
'List all the tables in the db
Dim table As DataTable
table = connection.GetSchema("Tabl
For Each row As DataRow In table.Rows 'output list of tables