Click here to Skip to main content
15,886,799 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
XML
I have 3 datatable dt,dt1,dt2....I am performing a join operations..

var query = from p in dt.AsEnumerable()
                  join a in dt1.AsEnumerable()
                  on p.Field<int>("LId") equals a.Field<int>("LId")
                  join t in dt2.AsEnumerable()
                  on a.Field<int>("LId") equals t.Field<int>("LId")
                  select new
                  {
                      EmpId = p.Field<int>("EmpId"),

                      EmpName = p.Field<string>("EmpName"),
                      LocationName = a.Field<string>("LocationName")
                  };
when i run this query i am getting error as Column 'LId' does not belong to table Table3.
Posted
Comments
yourfriendaks 7-Jun-13 5:22am    
give table structure......

This error means that your third datatable(dt2) does not have a column named "LId". Double check the columns and modify the join.

--Amit
 
Share this answer
 
Comments
Maciej Los 7-Jun-13 5:26am    
Exactly!
+5
_Amy 7-Jun-13 5:28am    
Thank you Maciej. :)
Hi,

Please look into the link once : here[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900