I
illday
Unregistered / Unconfirmed
GUEST, unregistred user!
SqlConnection con = new SqlConnection();
SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder();
builder.IntegratedSecurity = true;
builder.DataSource = "(local)";
builder.InitialCatalog = "xs";
con.ConnectionString = builder.ConnectionString;
con.Open();
//string[] restrictions = new string[4];
//restrictions[3] = "BASE TABLE";
//DataTable table = con.GetSchema("tables", restrictions);
如何继续获得数据库中的每个表的外键呢?
是用下面这句吗?
DataTable table = connection.GetSchema("ForeignKeys",new string[]{null,null,tableName });
好象不是,那应该怎么写呢?谢谢
SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder();
builder.IntegratedSecurity = true;
builder.DataSource = "(local)";
builder.InitialCatalog = "xs";
con.ConnectionString = builder.ConnectionString;
con.Open();
//string[] restrictions = new string[4];
//restrictions[3] = "BASE TABLE";
//DataTable table = con.GetSchema("tables", restrictions);
如何继续获得数据库中的每个表的外键呢?
是用下面这句吗?
DataTable table = connection.GetSchema("ForeignKeys",new string[]{null,null,tableName });
好象不是,那应该怎么写呢?谢谢