Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Foreign key problem
Message
De
07/02/2010 14:09:19
 
 
À
05/02/2010 18:32:41
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
LINQ
Versions des environnements
Environment:
ASP.NET
Divers
Thread ID:
01447781
Message ID:
01447995
Vues:
39
>>>>HI
>>>>
>>>>I've created a database in SQL2008. Two tables with a foreign key relationship.
>>>>
>>>>Then in Visual Studio2008 I'm trying to create a LINQ to SQL Data Model.
>>>>
>>>>I drag the tables onto the design surface but no Foreign key is appearing.
>>>>
>>>> I thought that appeared automatically if the key was defined in the database.
>>>>
>>>>Any ideas what I might have missed.
>>>>
>>>>
>>>>Thanks
>>>>
>>>>Nick
>>>
>>>Hmm I am not a EF person as of yet so take this with a grain of salt. I had heard the model hid the foreign key when there was a relationship set up as it takes care of that for you. Might want to do a search on that to see if I heard correctly.
>>>Tim
>>
>>Tim - I *think* you're thinking of the way EF will hide an intermediate linking table (when it contains only the keys). But I don't think it applies to L2Sql - and even it it did it wouldn't do so in this case where only two tables are involved.
>>
>>But Nick - can you clarify what you mean by "no foreign key is appearing".
>>Do you mean there's no association showing up in the diagram?
>>Can you, as Naomi suggested, post the code to create the DB?
>
>Thanks Viv,
>You are probably right as I wasn't too sure. I shouldn't have posted since I am not in the know on EF yet but; It is sooo slow here at the UT on Fridays I guess everyone typically is cramming on Friday to get done all the work they didn't get done over the week. OR.... they all get soo much done they can take Friday's off. :-)

If your analysis is correct it might be interesting to know which UTers fall into which category :-}
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform