检索实际的表模式(不包括addtional表模式)在vb.net中

时间:2015-12-29 04:55:14

标签: vb.net ms-access ado.net oledb

当我运行此代码时,它还会检索表中不存在的其他一些字段。如何克服这个?

Dim conn As New OleDb.OleDbConnection 'Create a connection string for an Access database Dim strConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=F:\check\a.mdb" 'Attach the connection string to the connection object conn.ConnectionString = strConnectionString 'Open the connection conn.Open() Dim Restrictions() As String = {Nothing, Nothing, selected, Nothing} 'selected contains the name of table 
 Dim CollectionName As String = "Columns" Dim dt As DataTable = conn.GetSchema(CollectionName, Restrictions) For Each TableRow As DataRow In dt.Rows ComboBox1.Items.Add(TableRow.Item("COLUMN_NAME"))

还检索到的附加模式是。

  1. ID
  2. 日期创建
  3. 日期更新
  4. Id
  5. Lv
  6. 姓名
  7. 父ID
  8. 输入
  9. GUID
  10. Id
  11. 还有6列,原始架构只有5列

0 个答案:

没有答案