Click here to Skip to main content
15,913,115 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Here i show two table table-1 and 2 now i want ID 3 data from Table-1 and ID-4 data from table-2 means date wise last two updated data in entity frame work ID and seqNum colum's data type is long.
Table-1
ID   date        
 1   21/10/2016
 2   22/10/2016
 3   24/10/2016


Table-2
seqNum     LCdate        
 1     21/10/2016
 2     22/10/2016
 3     23/10/2016
 4     25/10/2016


What I have tried:

C#
(from s in db.Table-1
select new
{
s.ID ,
seqNum= 0,
LCdate=s.date
}
.Concat(from s in db.Table-2
select new
{
ID=0 ,
s.seqNum,
s.LCdate
});
Posted
v4

1 solution

var result = (from a in
(from s in db.Table-1
select new
{
s.ID ,
seqNum= 0,
LCdate=s.date
}
.Concat (from s in db.Table-2
select new
{
ID=0 ,
s.seqNum,
s.LCdate
})
orderby a.LCdate descending
select a).Take(2);
 
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