Yogesh Vedpathak

Yogesh Vedpathak

  • 675
  • 1.4k
  • 192k

I am Getting Error Error 'System.Linq.IQueryable

Feb 19 2018 1:36 AM
public ActionResult Login(UserResgitartion objUser)
{
if (ModelState.IsValid)
{
using (MyDatabaseEntities Db = new MyDatabaseEntities())
{
var obj = Db.UserResgitartions.Where(a => a.UserName.Equals(objUser.UserName));
if(obj != null)
{
// Error here in userId and UserName  
Session["UserID"]= obj.UserId.ToString();
Session["USERNAME"] = obj.UserName.ToString();
return RedirectToAction("UserDashBoard");
}
}
}
return View(objUser);
}

Answers (4)