Consider i have 'n' tables which are created using MS Access.
Now i need to find the relationship among the tables. i.e How the tables are interlinked as changes made in a table will be reflected other table.?
is there any to find this using c#
Consider i have 'n' tables which are created using MS Access.
Now i need to find the relationship among the tables. i.e How the tables are interlinked as changes made in a table will be reflected other table.?
is there any to find this using c#
I am not sure how to find from C#. But in ms-access we can see easily find.
Open access database file. and click on Menu (Tools->Relationships). You can view the current relation ships.
Thanks and regards Haranadh
I don't believe you need to automate Access to do this. All that's needed, I think, is ADOX. This article shows how to use ADOX to copy relationships in VBA:
ACC2002: How to use ADOX to Import Relationships
Relationships are defined under the ADOX.Table.Keys property. I can't help you convert that to C#, but that code shows you what parts of the ADOX object model you need to use for this and ought to help you figure it out, I hope.
DataTable schemaTable = oledbConnection.GetOleDbSchemaTable(OleDbSchemaGuid.Foreign_Keys, new object[] {null, null, "OneTableName"});
or
DataTable schemaTable = oledbConnection.GetOleDbSchemaTable(OleDbSchemaGuid.Foreign_Keys, new object[] {null, null, "OneTableName", null, null, "OtherTableName"});