conn.Open();
string[] restrictions = new string[4];
restrictions[3] = “BASE TABLE";
DataTable table = conn.GetSchema("Tables", restrictions);
conn.Close();
获取表的信息:
conn.Open();
string[] restrictions = new string[4];
restrictions[1] = "dbo";
DataTable table = conn.GetSchema("Tables", restrictions);
conn.Close();
返回的table是表的所有信息,而不仅仅是名字,可以通过如下语句查看这些信息:
foreach (System.Data.DataRow row in table.Rows)
{
foreach (System.Data......
阅读全文