.net - C# Linq Join Into statement editor error -


var joinedtables =  tablerow in filteredtable.asenumerable()                     join contactsrow in contacts.asenumerable()                     on tablerow.field<double>("opportunity: store number") equals contactsrow.field<double>("national store .")                     lj                     r in lj.defaultifempty()                     select resulttable.loaddatarow(new object[]                     {                         tablerow.field<double>("opportunity: store number"),                         tablerow.field<datetime>("target circuit completion (foc)"),                         tablerow.field<string>("vendor name"),                         contactsrow.field<string>("contacts - acm - email")                     }, false); 

i trying left-outer-join on 2 tables using linq using this answer. when try add fields contactsrow object array argument of .loaddatarow() function, editor says 'contactsrow' not exist in current context. how code different answer in link? have been trying learn lineq avoid crazy-nested loops has me stumped. more code here.

edit:

var joinedtables =  tablerow in filteredtable.asenumerable()                             join contactsrow in contacts.asenumerable()                             on tablerow.field<double>("opportunity: store number") equals contactsrow.field<double>("national store .")                             lj                             r in lj.defaultifempty()                             select resulttable.loaddatarow(new object[]                             {                                 tablerow.field<double>("opportunity: store number"),                                 tablerow.field<datetime>("target circuit completion (foc)"),                                 tablerow.field<string>("vendor name"),                                 r.field<string>("contacts - acm - email"),                                 r.field<string>("oo - ops mgr name"),                                 r.field<string>("contacts - area sup / bc - email"),                                 r.field<string>("contacts - otp - email"),                                 r.field<string>("otm email address")                             }, false);         return resulttable; 

i changed code resulttable r in select statement suggested. code compiles resulttable empty.

you need select r not contactsrow.


Comments

Popular posts from this blog

python - Healpy: From Data to Healpix map -

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -