public static CustomUserInfo GetUserInfoCustomSP(string username) { CustomUserInfo result = new CustomUserInfo(); using (UsersDataContext dc = new UsersDataContext()) { var dbresult = dc.aspnet_GetUserInfoCustomSP(username); if (dbresult.Count() > 0) { dbresult = dc.aspnet_GetUserInfoCustomSP(username); var record = dbresult.SingleOrDefault(); result.IsApproved = record.IsApproved; result.IsLockedOut = record.IsLockedOut; result.InvalidUserName = false; } else { result.InvalidUserName = true; } } return(result); }