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.
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Sudhakar ChaudharyRank #1,379 · 1.2K reputationPosted Oct 28, 2012, 1:43 AM EDT
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.");
}
vikas kanani147 reputationPosted Oct 28, 2012, 2:05 AM EDT