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.
 
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.
 
Back
Top