public static string getOffer()
{
var context = new admiralE();
var u = Membership.GetUser().UserName;
var a = (from n in context.a_online
where n.asked == u
select n).FirstOrDefault();
string i = a.user; //debugging line
return a.user;//error here
}
I have a very simple method that is causing me the above error when there are no resolts for "a".
return a.user causes the error, or better said whenever I want to use a.user, it causes the error.
the "string i=a.user" line (just for debugging) would also report the same error. I cannot even test for null or string lenght...
...
Go to the complete details ...