I have 2 table having data as dt1 and dt2 on the basis of id
id column1 column2
1 abc
id column1 column2
1 def
How should I can make it as
id column1 column2
1 abc def
I need a c# code
I have 2 table having data as dt1 and dt2 on the basis of id
id column1 column2
1 abc
id column1 column2
1 def
How should I can make it as
id column1 column2
1 abc def
I need a c# code
Answer taken from: https://stackoverflow.com/a/2767742/2537148
var query = database.dt1// your starting point - table in the "from" statement
.Join(database.dt2, // the source table of the inner join
post => dt1.id, // Select the primary key (the first part of the "on" clause in an sql "join" statement)
meta => dt2.id, // Select the foreign key (the second part of the "on" clause)
(dt1, dt2) => new { Dt1= dt1, Dt2= dt2}); // selection