1
your LINQ query seems to be correct,
however when you day the SQL query works but the LINQ does not, I want to highlight that in SQL Query you have used recordid = 1 which may be returning record as there are records with recordid = 1
while in LINQ you are using a variable, make sure to run the SQL query with value of that variable, may be there are no records in table with that id being passed to LINQ?
0
i tried by hardcoding the value also but still no results
0
both the replies r giving count as 0
0
Can you try something like this?
- var id = db.InfoMaster.Where(x1 => x1.recordid == 1).OrderByDescending(x2 => x2.CreationDate).Select(x3 => x3.InfoId).FirstOrDefault();
-
- var record =db.InfoDetails.Where(u => u.InfoId == id);