There is a problem I need help with your query on the data using LINQ to SQL and Entity Framework (I'm using Visual Studio 2010).
My picure hereI have three tables: http://img.tamtay.vn/files/photo2/2010/5/28/10/962/4bff3a3b_1093f58f_untitled-1.gif
I have three tables:
tbl NewsDetails
tblNewsDetailstblNewsCategories
tblNewsCategoriestblNewsInCategories
tblNewsInCategories
(See screenphoto 1 in mythe picture below.)
Now, I want to retrieve records in the I want to retrieve records in the tblNewsDetails tabletblNewsDetails table, with condition: CategoryId=1 CategoryId=1, as the following results:
(See screenshown in photo 2 in mythe picture) below.
But NewsIDNewsID and CategoryIdCategoryId in tblNewsInCategoriestblNewsInCategories table isare two foreign key,keys. I do not see them and I do not know how to use them in yourmy code.
My code has errors:
(See screen Also, my code has errors, shown in photo 3 in mythe picture) below.
http://img.tamtay.vn/files/photo2/2010/5/28/10/962/4bff3a3b_1093f58f_untitled-1.gif