views:

145

answers:

2

I a working in VisualStudio 2005. I have a dataset with sevaral datatables in it already. I had to modify the database to add a new foreign key that I forgot about. How do I get visual studio to recognize the new relationship?

+1  A: 

.Net does not load FK relationships into your DataSet automatically - however, you can add them yourself with a DataRelation*.

*this may not be true if you are using LINQ - if you are, I am unsure.

Tom Ritter
A: 

Right-click on the DataSet page, and select Add->Relation?

If you've defined it in your database, you can always re-drag the affected table back into the Dataset then re-enter your Queries.

BenB