Hi
The output of thisday format/datatype is not equle with what ever you have in your database, which means in database you have Date&Time with this format 4/04/2015 12:00:00 AM if you want to compare this format/datatype with current Date&Time (in this case thisday) you need to do like this:
DateTime thisDay = DateTime.Today;
DateTime tag = r.GetDateTime(0);
int result = DateTime.Compare(thisDay, tag);
if (result < 0)
relationship = "is earlier than";
else if (result == 0)
relationship = "is the same time as";
else
relationship = "is later than";
Other related useful codes:
DateTime myDateTime = DateTime.Now;
string sqlFormattedDate = myDateTime.ToString("yyyy-MM-dd HH:mm:ss");
Related Links:
http://www.java2s.com/Tutorial/CSharp/0560__ADO.Net/SqlDataReaderGetStringGetDateTime.htm[
^]
https://msdn.microsoft.com/en-us/library/system.datetime.compare(v=vs.110).aspx[
^]
http://www.dotnetperls.com/datetime-format[
^]
https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx[
^]
R,
Aydin