2

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?

tshepang
  • 12,111
  • 21
  • 91
  • 136
poy
  • 10,063
  • 9
  • 49
  • 74

1 Answers1

2

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.

Mahmoud Gamal
  • 78,257
  • 17
  • 139
  • 164