TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Sheffer Fernandes
NA
15
3.2k
how to compare currentdate wth db date using if
Feb 5 2015 1:08 AM
guy plz help me in comparing currentdate from db using if statement.
my error is dat nothungnis happening after button click
code:
{
connect.Open();
OleDbCommand command = new OleDbCommand();
command.Connection = connect;
string query = "select AttendanceDate from AttendanceTable where AttendanceDate=Date()";
command.CommandText = query;
OleDbDataReader reader = command.ExecuteReader();
while (reader.Read())
{
// string workername = reader["WorkerName"].ToString();
string AttDate = reader["AttendanceDate"].ToString();
string date=DateTime.Now.ToString("yyyy/MM/dd");
if(AttDate==date)
{
MessageBox.Show("hi");
}
}
connect.Close();
}
Reply
Answers (
5
)
Syntax highlighting in richtextbox
Add selected item from a bound listbox to a unbound listbox