hi,
In my windows application form have 2 labels(startdate,enddate), 2 datetime picker, 2textboxes,datagridview(in that datagridview gather the data from sql server table) and one submit button.
when i run the application,i will give startdate and enddate using datetimepicker.then the gridview shows data's with in the range of start date and end date.what can i do.please help me.
thanks & Regards,
Gokilavasan.M
Loading
Satyapriya NayakPosted Jun 19, 2012, 4:35 AM
Use these queries to filter data
str = "select * from employee where CreatedDate between '" +dateTimePicker1.Value.Date.ToString() + "' and '" + dateTimePicker2.Value.Date.ToString() + "'";
Or
str ="select * from employee where CreatedDate>='" + dateTimePicker1.Value.Date.ToString() + "' and CreatedDate<='" + dateTimePicker2.Value.Date.ToString() + "'";
Thanks