c# - .NET SQL Query joining two different tables -


i'm brand new .net mvc, , while have basic experience writing sql queries, i'm not sure how go need .net.

my initial query looks this:

var results = (from s in db.members                 join sa in db.focusarea on s.id equals sa.memberid                 sa.area == searchstring                 select new { s.id, s.name, s.overview }).tolist(); 

this not functioning correctly. seaching in s.overview reason. and, need make query more complicated. in short, have 3 tables need search across. , query, not working:

var conceptresults = (from s in db.cohorts                        join oa in db.outcomearea on s.id equals oa.cohortid                        ((oa.area.contains(searchstring))                           || (oa.outcometype.contains(searchstring)))                        select new { s.id, s.name, s.overview }).tolist(); 
  1. i need use searchstring search matches in both area , description in db.focusarea.

  2. i need use searchstring search matches (contains) in table db.specificfocusareas column sfocusarea again join id/memberid.

is there way join or join type of statement? don't want join 3 tables because looking results either of 2 joins, not joins.


Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -