How to check if one DateTime is greater than the other in C#
if (StartDate < EndDate)
// code
if you just want the dates, and not the time
if (StartDate.Date < EndDate.Date)
// code
if(StartDate < EndDate)
{}
DateTime supports normal comparision operators.
You can use the overloaded < or > operators.
For example:
DateTime d1 = new DateTime(2008, 1, 1);
DateTime d2 = new DateTime(2008, 1, 2);
if (d1 < d2) { ...