views:

65

answers:

1

I have three tables in my DB (actually a few more than that) these are:

Users
-----------
ID (PK)   
Name

Sites
-----------
ID (PK)  
SiteName

Users_Sites
-----------
ID (PK)  
UserID (FK to Users.ID)  
SiteID (FK to Sites.ID)

and I have a unique constraint on UserID and SiteID in the Users_Sites table. All very standard stuff.

My problem is that when dragging these tables into the LINQ-SQL designer I can see the relationship between the Sites and the Users_Sites tables, but not the relationship between the Users and Users_Sites tables. I tried creating an equivalent diagram in SQL Enterprise Manager, which verified that the relationships were actually there.

Is there a known issue with the LINQ-SQL designer, or is there something special I should be doing?

+1  A: 

Hey mdresser, I know this may sound stupid, but have you tried restarting Visual Studio?

I've come across this several times, and its always Visual Studio 2008 going a bit mental.

Re-starting it fixed it every time.

Just make sure that your relationships are in fact in the DB, and make sure you've refreshed your connections in the Server Explorer before dragging in.

Finally, doing a build before adding the tables sometimes helps...

I know it sounds random, but let me know

cheers

andy
Cool, thanks for the tip. Restarting did the job!
mdresser