在VB.net中访问表 [英] Access tables in VB.net
本文介绍了在VB.net中访问表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何获取Access数据库中的表列表
让我们考虑Sample.mdb是数据库,它具有表A,B,C
我想在ListView中检索A,B,C.
How do i get list of tables in access database
lets consider Sample.mdb is database and it has tables A,B,C
I want to retrive A,B,C in ListView
推荐答案
使用以下代码:
Use the code below:
Dim sConn As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Sample.mdb"
Dim olecon As New OleDbConnection(sConn)
olecon.Open()
Dim dt As DataTable = olecon.GetSchema("tables")
olecon.Close()
GridView1.DataSource = dt
GridView1.DataBind()
这篇关于在VB.net中访问表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文