J
Jim H
Pid.DBMil lMil = null;
if (null == lMil)
System.Diagnostics.Trace.WriteLine("\r\nIt was NULL\r\n"); //-- this
never prints
That diag line never prints.
later on in a loop I do this:
for (int i = 0; i < liLoopCount; i++)
{
if(lMil == null)
lMil = new Pid.DBMil();
lMilCode.GetData(i); //--Causes a null refernce exception
//more code here
}
How do you check to see if a variable is referencing null?
Thanks in advance,
jim
if (null == lMil)
System.Diagnostics.Trace.WriteLine("\r\nIt was NULL\r\n"); //-- this
never prints
That diag line never prints.
later on in a loop I do this:
for (int i = 0; i < liLoopCount; i++)
{
if(lMil == null)
lMil = new Pid.DBMil();
lMilCode.GetData(i); //--Causes a null refernce exception
//more code here
}
How do you check to see if a variable is referencing null?
Thanks in advance,
jim
