Posted on: 1/3/2015 10:15:40 AM | Views : 720

Hello Every one
i need to store the selected value from linq to variable, i have a table field like FullName so i need to get the name for display how to do that or how to store my fullname in loginnames

here is the sample code for your reference 

string UserName = Request.Form["Username"]; string password=string.Empty; string loginnames=string.Empty; CommonDataContext CDC = new CommonDataContext(); var query = (from LoginDet in CDC.tblUsers where LoginDet.UserID == UserName && LoginDet.Password == SimpleHash.Encrypt_QueryString(Request.Form["password"] ) select LoginDet.FullName ); if (query != null) { HttpCookie logincookie = new HttpCookie("logincookie"); logincookie.Value = LoginDet.FullName;  // Herer Error Occured logincookie.Expires = DateTime.Now.AddHours(1); Response.Cookies.Add(logincookie); Response.Redirect("~/accoun ...

Go to the complete details ...