共计 432 个字符,预计需要 2 分钟阅读。
珍惜源码,传播留址[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;
}
测试运行

正文完