hello
I have two dateTimePicker taskDate and taskTime one for setting date and one for setting time ...
And i have taskDate,taskTime coloums in my database..
I wanted to control every time opening project to look if the taskDate is bigger then now and if bigger give alert ...but i can not do this...help..help...
My strSql
//
// in database taskDate format is datetime and taskTime format is text
strSQL="INSERT INTO Tasks (...,taskDate,taskTime,...) where (....,'"+DateTime.Parse(TaskDate.Text).ToShortDateString()+"','"+DateTime.Parse(TaskTime.Text).ToLongTimeString()+"'.....)
i savede these values to my database(for example date is 12/01/2004 and time is 12:21:00 ) but when i wanted to control dates i have problem it did not control
DateTime dti = DateTime.Now;
string strSQL ="SELECT * FROM Tasks WHERE ( taskDate < dti)";
DataTable dt = new DataTable(strSQL);
if(dt.Rows.Count>0)
{
MessageBox.Show("there is data!");
}
else{
MessageBox.Show("there is no data");
}
can you help me...
how can i compare these values with DAteTime.Now...