c# - Linq Join error -


i'm receiving following error on below linq query (line 2) , don't understand how correct it.

the type of 1 of expressions in join clause incorrect. type inference failed in call 'join'.

all 2 variables in equals expression (string) i'm not sure why error result. have suggestions?

var studentlist = t1 in  extern                   join t2 in empstatus //m receiving error here                    on new { t1.id} equals new { id= t2.id }                   join t3 in statusofemp                   on new { t2.sta_id } equals new {sta_id = t3.sta_id }                   t3.status = "inaktiv"                    select new { t1.name }; 

there no need create new anonymous objects when using join.

try instead:

var studentlist =      t1 in  extern     join t2 in empstatus     on t1.id equals t2.id     join t3 in statusofemp     on t2.sta_id equals t3.sta_id     t3.status = "inaktiv"      select new { t1.name }; 

Comments

Popular posts from this blog

c++ - CryptStringToBinary API behavior -

java.util.scanner - How to read and add only numbers to array from a text file -

iphone - Three second countdown in cocos2d -