Pergunta

I need to covert that sql code into ADO.net entity framework code please need some one help because i am new to the mvc asp.net .

Thnaks

SELECT A.cid, A.cname,    
B.sid, B.lname,B.fname,    
C.section,c.crn    
FROM courses A, students B, sections C, Registration D    
WHERE A.cid = C.cid AND    
B.sid = D.sid AND    
c.crn = d.crn AND    
c.crn = 1003 ;    
ORDER BY B.lname,B.fname ASC;
Foi útil?

Solução

From the code you posted in the comment you should do something like this to get the list ordered like you want.

var tblemployees = db.tblEmployees
                   .Include(t => t.tblDepartment)
                   .OrderBy(y => y.FirstName)
                   .ThenBy(x => x.LastName).ToList();
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top