I am developing a system reminder application where the date n time are inserted along with a message in the database.when the datetime from the database matches with the current system datetime,it should display an alertbox.
I am inserting date and time with datetimepicker.
i will be able to get current datetime via datetime.now method but how should i match it with the database?
arunair
0
Newbie Poster
Recommended Answers
Jump to PostDateTime has a Compare method.
DateTime also has some operator overloads like == to test two dates for equality.
There is also the TimeSpan structure.
Jump to PostAs ddanbe said. I will only show an example:
DateTime dateNow = DateTime.Now; // I will add just an example dateTime: DateTime dateFromDataBase = new DateTime(2011, 3, 21); //comparing both dates: if (dateNow.Date == dateFromDataBase.Date) { //if both dates are equal do code in here: } else …
All 6 Replies
ddanbe
2,724
Professional Procrastinator
Featured Poster
Mitja Bonca
557
Nearly a Posting Maven
arunair
0
Newbie Poster
Mitja Bonca
557
Nearly a Posting Maven
abelLazm
183
Postaholic
arunair
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.