get column names
-
I need to know how to get the column names of a database. I want to offer my users the ability to choose a database from a list of databases and then have them select what columns they want. I want to know how to get the column names and store them in a combobox. Does anyone know how to do this or where I can find an article? Thank you.
-
I need to know how to get the column names of a database. I want to offer my users the ability to choose a database from a list of databases and then have them select what columns they want. I want to know how to get the column names and store them in a combobox. Does anyone know how to do this or where I can find an article? Thank you.
This is from something I wrote a while back for checking the structure of an Access table, it might be of some help to point you in the right direction:
Dim tblExport As DataTable Dim TableName as string = "tblTest" tblExport = TestConnection.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, New Object() {Nothing, Nothing, TableName, "TABLE"})
-
This is from something I wrote a while back for checking the structure of an Access table, it might be of some help to point you in the right direction:
Dim tblExport As DataTable Dim TableName as string = "tblTest" tblExport = TestConnection.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, New Object() {Nothing, Nothing, TableName, "TABLE"})
The Microsoft SQL Server equivalent is: SELECT syscolumns.name FROM syscolumns INNER JOIN sysobjects ON syscolumns.id = sysobjects.id WHERE sysobjects.name = ''
Daniel Minnaar .NET Solutions Architect