M
Mark
Assume that "some_app_setting" does not exist in my web.config file. Then,
the first line of code below assigns the value null to strApplication. Why
doesn't my IF statement return true, and therefore execute the
Response.Write statement? Is there an alternative way to compare it to
null?
Thanks!
Mark
String strApplication=
ConfigurationSettings.AppSettings["some_app_setting"];
if (DBNull.Value.Equals(strApplication))
{
Response.Write("This should print because strApplication is null");
}
the first line of code below assigns the value null to strApplication. Why
doesn't my IF statement return true, and therefore execute the
Response.Write statement? Is there an alternative way to compare it to
null?
Thanks!
Mark
String strApplication=
ConfigurationSettings.AppSettings["some_app_setting"];
if (DBNull.Value.Equals(strApplication))
{
Response.Write("This should print because strApplication is null");
}