我正在尝试使用 ADO.Net 获取表的所有关系。我有以下代码,但无法获取 Data.Relations 或 DataSet.Tables[0].ChildRelations/ParentRelations
string query = string.Format("SELECT TOP 0 * FROM {0}", tableName);
var ds = new DataSet(tableName);
SqlCommand sqlCmd = new SqlCommand(query, connection);
SqlDataAdapter sda = new SqlDataAdapter(sqlCmd);
sda.FillSchema(ds, SchemaType.Source, tableName);
sda.Fill(ds, tableName);
sda.Dispose();
谢谢!