c# Column datatype Date type (NOT DateTime)
- by Sha Le
Hi All:
I want know is there good way to detect Column DataType for Date field (NOT DateTime)?
This what currently I do:
switch (dt.Columns[col].DataType.FullName)
{
case "System.DateTime":
formatedVal = Formatter.GetDateTime(val);
break;
// which is NOT possible, but something equivalent am looking for
case "System.Date":
formatedVal = Formatter.GetDate(val);
break;
default:
formatedVal = val.ToString();
break;
}
Thanks a bunch. :-)