开发者

how to obtain list of tables in an access mdb database with C# [duplicate]

This question already has answers here: 开发者_C百科 Closed 11 years ago.

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();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜