SyntaxFix
Write A Post
Hire A Developer
Questions
You could always use typeof in the if statement. It is better than working with string values like the answer of Natarajan.
typeof
if (dt.Columns[0].DataType == typeof(DateTime)) { }