Click here to Skip to main content
15,902,198 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
I am trying to display the result from this query in my index view, but it is reporting error, i have tried to debug it, no success, i will appreciate if anyone could assist in letting me know where i have gone wrong.

C#
public ActionResult Index()
    {           
       var users =
        (from u in db.Users
                     join s in db.States
                         on u.StateId
                         equals s.StateId

                     join l in db.Lgas
                         on u.LgaId
                         equals l.LgaId
                     select new
                     {
                         u.Surname,
                         u.Firstname,
                         u.Othernames,
                         u.Email,
                         s.StateName,
                         l.LgaName
                     }).ToList();


        return View(users);
    }
Posted
Comments
Krunal Rohit 29-Oct-15 8:54am    
What error ?

-KR
Suvendu Shekhar Giri 1-Nov-15 5:09am    
Unless you share the exact error it will be difficult to identify the error for us.

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