Retrieving Metadata - Foreign Keys
Posted: Sat 04 Feb 2006 17:30
Please help me to retrieve Foreign Keys.
This is my code to retrieve Primary Keys:
I have to write the same method in order to retrieve the Foreign Keys.
Thanks,
Nunzio
This is my code to retrieve Primary Keys:
Code: Select all
private DataTable GetPrimaryKeys(string tablename)
{
conn.Open();
DataTable schemaTable = new DataTable();
schemaTable.PrimaryKey = conn.GetSchema("Columns", new string[] { "Test", tablename }).PrimaryKey;
conn.Close();
return schemaTable;
}
Thanks,
Nunzio