poy
poy

Reputation: 10507

Looking for foreign keys in a DataSet

Is there a way to look for all of the foreign keys in a data set?

I know there's a way to look for all of the relations:

new DataSet().Relations

Is there a similar proptery for just foreign keys?

Upvotes: 2

Views: 4612

Answers (1)

Mahmoud Gamal
Mahmoud Gamal

Reputation: 79929

There is a foreignkeyconstraint Class, so for each DataTable in your dataset you can find the list of its Constraints, which will give you all constraints including any foreign keys of type foreignkeyconstraint.

Upvotes: 2

Related Questions