| Glen Wells 2004-10-15, 9:13 pm |
| Choi,
You cannot test for something being null in this way, because if it is null,
the Equals() method will not be available... and you get a
NullReferenceException, which is exactly what you are trying to avoid!
You should use if(objNavChannel == null).
Try this code to see what I mean:
string test = null;
try
{
if(test.Equals(null)) Response.Write("Equals() works!!<br>");
}
catch
{
Response.Write("Equals() does not work<br>");
}
try
{
if(test == null) Response.Write("== works!!<br>");
}
catch
{
Response.Write("== does not work<br>");
}
--
Glen Wells
www.cubik.co.uk
"choihead" <choihead@Hotmail.com> wrote in message
news:OtAf6EEsEHA.1816@TK2MSFTNGP09.phx.gbl...
> Line 286 is this
>
> //Error check for null Channel
> if(objNavChannel.Equals(null))//Line 286
> {
> return table; //Early return
> }
> So it is null and cannot return the table??
> "Stefan [MSFT]" <stefang@online.microsoft.com> ¦b¶l¥ó
> news:u8gKF8DsEHA.1692@TK2MSFTNGP10.phx.gbl ¤¤¼¶¼g...
> rights.
> http://download.microsoft.com/downl...6a/MCMS+2002+-+(complete)+FAQ.htm
> http://www.gotdotnet.com/community/...t+S
erver
>
>
|