Here's another one (hooray). I'm declaring a private variable like so:
csharp code:
private string m_AffiliateName;
Then trying to write a sort-of "cover all" function to convert from an XML file (thus, a string) into the relevant data type:
csharp code:
if (target.GetType() == typeof(System.DateTime))
{
target = DateTime.Parse(nav.Value);
} else {
target = nav.Value;
}
Problem is, when I run it, it tells that it can't GetType on target, because it's null. Which it is- this is the first time I'm trying to assign to it. But is there some way to get the underlying type of an object, even if it's null?
EDITED: 8 Dec 2008 12:47 by ALLY