Is it possible to get all the column names in a database table?

  • Thread starter Thread starter Showjumper
  • Start date Start date
S

Showjumper

Is it possible to retrieve a table name and then all the column names in
that table from an access database? And then once that is done, then build a
sql insert statement using the retrieved table and columns names?

Thanks
Ashok
 
Study the OleDb CommandBuilder and related classes. These are desgned to
take a SELECT statement and generate insert, update and delete logic
programmatically.

To just get a list of table names, you would use
OleDbConnection.GetOleDbSchemaTable with OleDbSchemaGuid.Tables

--Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top