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

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
 
P

Peter Bromberg [C# MVP]

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top