comparing date in c#
how to compare stored date and today date.if stored date is less than today date...want to display those records in gridview.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
vikas kananiPosted Oct 28, 2012, 6:05 AM
Sudhakar ChaudharyPosted Oct 28, 2012, 5:43 AM
SELECT * FROM TABLENAME WHERE STORE_DT
C#:
DateTime storedDate = Convert.ToDateTime("30/10/2010");
DateTime currentDate = DateTime.Now;
if (storedDate < currentDate)
{
Console.WriteLine("Ture.");
}
else
{
Console.WriteLine("False.");
}