I tried the following code for my requirement. My requirement is to pass the value as "YELLOW" in a text box if the target date is with in 3 days.
XPathNavigator GYR = MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:field154", this.NamespaceManager);
XPathNavigator Date1 = MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:field98", this.NamespaceManager);DateTime tempdate,today;
tempdate = Date1.ValueAsDateTime;
today = DateTime.Now;
TimeSpan ts = tempdate - today;string days = ts.Days.ToString();if ((days == "3") || (days == "2") || (days== "1") || (days== "0"))
{
GYR.SetValue("Yellow");
}
This code is giving me the error at line tempdate=Date1.ValueAsDateTime as follows
"The string '' is not a valid AllXsd value."
Why I am getting this message?