I'm using LINQ to Entities in a C# program with the following code...
I get a run time exception "Object reference not set to an instance of an object" How do I check if prof.Title not equal to null?
I'm sorry if I'm a bit of a pain with all my questions, believe me I'm not stupid :-D, but I have no other way of learning all this good stuff.
Joe
Code:
...
var prof = (from p in de.ProfT
where p.ProfT == ProfTitle
select p).FirstOrDefault();
if (prof.Title != null)
{
Do some stuff
}
I'm sorry if I'm a bit of a pain with all my questions, believe me I'm not stupid :-D, but I have no other way of learning all this good stuff.
Joe
Comment