Say you have a list of IDs:
string str = "82174F2000000, 82174F2000001,
82174F 2000002, 82174F 2000003, 82174F 2000004, 82174 F 2000005 "; And you do this:
var tids = new list & lt; String & gt; (Str.Replace (",", ","). Split (',')); Var tntable = tids.AsQueryable (); Join and you want to add it to a table:
var line = c from db.Ctable Join l in tntable at c. In Carid L. Carrid, c_j is equal to L. c_j.DefaultIfEmpty () Select new {name = c.OwnerName, hours = c.Hours}; It seems that there is no area called 'carrade' in the tentable.
Can anyone help?
It exists from LINQ.
I have seen this:
But do not know to join the left.
TIA!
I know it's long; But thanks for reading.
Update for Mac: We have these cards in the database in the kernel:
Carid _____ 82174F2000000 82174F2000001 82174F2000002 82174F2000003 Let's just say that there is a broken string in the record (tntable):
caried _____ 82174 F 2000000 82174 F 2000001 82174F 2000002 82174 F 2000003 82174 F 2000004 82174 F 2000005 So, join a left like this:
select c. Sirida, T. Include Seanless C LEFT Tentable TC Ceridate = T. Carid will provide you with:
T. Caried c. Karid _______ _______ 82,174 F 2000000 82 174 F 2000000 82 174 F 2000001 82 174 F 2000001 82 174 F 2000002 82 174 F 2000002 82 174 F 2000003 82 174 F 2000003 82 174 F 2000004 tap 82174 F 2000005 NULL
If I'm reading your question it seems that you do not display the list of IDs you want to filter on any ground, left to join me think Is that you want something like this:
var line = from c in db.Ctable where tntable.Contains (c.carid) is new {name = c.OwnerName, hours = c.Hours Choose }; Update: You are included in the selection statement to return everything. = Tntable.Contains (c.CarID), name = c.OwnerName, hours = c.Hours};
Update 2: Okay, how about this. Use my original to pull relevant items of SQL, then in fact the clinic to use the objects you want the way you used to create the list. .toList () forces it to create SQL queries. you can use. ANN Merebel () Select <{P>
var filtered = from c in db.Ctable where tntable.Contains (c.CarID) new {CarID = c.CarID, name = c. Owner name, hours = c. Horse}; To join tntable in Var line = x, I filtered.ToList () on x is equal to i.m. I_match in i_match.If select i_match.DefaultIfEmpty () {x, i};
Comments
Post a Comment