【发布时间】:2019-01-19 16:44:25
【问题描述】:
目前,我在 GetOleDbSchemaTable 的帮助下获取表和列。我也想知道给定的列是否是必需的。
string[] rest = new string[] { null, null, tableName, null };
DataTable rows = conn.GetOleDbSchemaTable(OleDbSchemaGuid.Columns, rest);
foreach (DataRow rr in rows.Rows)
{
string tbrow = rr["COLUMN_NAME"].ToString();
int colnum_type = Int32.Parse(rr["DATA_TYPE"].ToString());
string datatype = get_dataType(colnum_type)
}
这样我得到了给定列的列和数据类型。现在我想获取列表或获取表格中所需字段的方法。
【问题讨论】:
标签: c# ms-access vb.net-to-c#