本文最后更新于 1201 天前,其中的信息可能已经有所发展或是发生改变。
珍惜源码,传播留址
[v_notice]引用命名空间
using System.Collections.Generic; using System.Data; using System.Data.OleDb; using System.Text;
[/v_notice]
public List<string> GetList(string tn) { DataTable table = dbcon.GetOleDbSchemaTable(OleDbSchemaGuid.Columns, new object[] { null, null, null, null }); List<string> ts = new List<string>(); foreach (DataRow row in table.Rows) { if(row["TABLE_NAME"].ToString()==tn) ts.Add(row["COLUMN_NAME"].ToString()); } return ts; }
测试运行
查询结果:{ID,测试1,测试2,}