how to display all the table name(in database) in a page?

  • Thread starter Thread starter netbee
  • Start date Start date
Try this:
oleDbConnection1.Open();

DataTable schemaTable =

oleDbConnection1.GetOleDbSchemaTable(OleDbSchemaGuid.Tables,

new object[] {});

oleDbConnection1.Close();

You'll get a DataTable full of table entries.

You can use it as a datasource, perhaps for DataGrid.
 
how do you get column info (e.g., names, data type, constraints) on a
per table basis?
 
Hi ToddT,

Just change Tables to Columns

oleDbConnection1.GetOleDbSchemaTable(OleDbSchemaGuid.Columns,

--
Miha Markic - RightHand .NET consulting & development
miha at rthand com

ToddT said:
how do you get column info (e.g., names, data type, constraints) on a
per table basis?

Try this:
oleDbConnection1.Open();

DataTable schemaTable =

oleDbConnection1.GetOleDbSchemaTable(OleDbSchemaGuid.Tables,

new object[] {});

oleDbConnection1.Close();

You'll get a DataTable full of table entries.

You can use it as a datasource, perhaps for DataGrid.
 

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