纸上得来终觉浅,绝知此事要躬行。

 

获取所有Access数据库中的名表方法

获取所有Access数据库中的名表方法

protected void Page_Load(object sender, EventArgs e)
{
OleDbConnection con
= new OleDbConnection("Provider = Microsoft.ACE.OLEDB.12.0; Data Source = |DataDirectory|/mm.accdb;");
con.Open();
DataTable dt
= con.GetSchema("tables");
GridView1.DataSource
= dt;
GridView1.DataBind();
}

以上方法测试通过。不过也有系统表的名称,还要再过滤,才能得到纯用户所建的表名

posted on 2011-01-25 18:21  JRoger  阅读(394)  评论(1)    收藏  举报

导航