how to obtain list of tables in an access mdb database with C# [duplicate]
Possible Duplicates:
Retrieve List of Tables in MS Access File How can I get a list of tables in an Access (Jet) database? Finding Tables in MS Access using C# What is the OleDb equivalent for INFORMATION_SCHEMA
Is there a way to obtain the list of all tables in an.mdb file along with their associated row counts?
Use this :
con.Open();
DataTable dt = con.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, new object[] {null, null, null, "TABLE"});
for (int i=0;i< dt.Rows.Count;i++)
{
MessageBox.Show( dt.Rows[i]["TABLE_NAME"].ToString());
}
con.Close();
精彩评论