Author: drl | Posted on: 12/11/2009 10:01:31 AM | Views : 352

 I got this code segment off the Web for checking for a valid date. It gives me a compilation error that
"Cannot convert null to 'System.DateTime' because it is a value type." Can you help?
Thanks,
Dave
 
 
public static bool IsDate(string anyString)
{
   if (anyString == null)
  {
    anyString = "";
  }
   if (anyString.Length > 0)
   {
     DateTime dummyDate = null;
     try { dummyDate= DateTime.Parse(anyString);
   } catch { return false;
     } 
       return true;
      }
   else
     {
       &nbs ...

Go to the complete details ...