Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have used Linq to Entity with Visual Studio 2008 but now i have met a problem about table's foreign key. Please help me! Thank you very much
Description: I want to get combobox's value to transmit for table's foreign key.

this in case table Products has foreign key concern to table Categories in Northwind Database

I have code :
Products _producAdd = new Products();
_producAdd.CategoriesReference.EntityKey.EntityKeyValues[0].Value =       cbbCategory.SelectedValue.ToString();//mistake at this row


Please help me !
Posted
Updated 28-Apr-11 20:43pm
v3
Comments
OriginalGriff 29-Apr-11 2:43am    
Do you get an error message?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900