我试图通过打开OleDbConnection来读取Access数据库中的表"Streets"的列名.我打电话给GetOleDbSchemaTable,但我似乎无法弄清楚如何进入我的专栏.
如果可能的话,我想使用.NET 3.5框架.
using (OleDbConnection connection = new OleDbConnection(connectionString)) { connection.Open(); DataTable tableColumns = connection.GetOleDbSchemaTable(OleDbSchemaGuid.Columns, new object[] { null, null, "Streets", null })); foreach (DataRow row in tableColumns.Rows) { var columnNameColumn = row["COLUMN_NAME"]; var dateTypeColumn = row["DATA_TYPE"]; var ordinalPositionColumn = row["ORDINAL_POSITION"]; ... } }