How to join 2 tables with entity framework and then retrieve one data from column among joined table and bind to textbox.
Can anybody help me in this problem.
Thanks a lot :-)
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Asp.Net HeinRank #6,010 · 279 reputationPosted May 6, 2015, 10:40 PM EDT
Sibeesh VenuRank #27 · 42.9K reputationPosted May 6, 2015, 10:37 PM EDT
You can do something like this,
var entryPoint = (from ep in dbContext.tbl_EntryPoint join e in dbContext.tbl_Entry on ep.EID equals e.EID join t in dbContext.tbl_Title on e.TID equals t.TID where e.OwnerID == user.UID select new { UID = e.OwnerID, TID = e.TID, Title = t.Title, EID = e.EID }).Take(10);See here for more info: http://stackoverflow.com/questions/21051612/entity-framwork-join-3-tables
Please accept as answer if it helps you.
Kindest Regards
Sibeesh Venu
www.sibeeshpassion.com
Sibeesh VenuRank #27 · 42.9K reputationPosted May 6, 2015, 10:46 PM EDT
You mean you need to return only one field from the query? If yes you can select only one (Which field you need to bind to text box) from the query as follows.
select new { UID.Yourfield }