How to format a Date Field in DataView.RowFilter to consider Date and time.

Posted by Bageshkumarbagi under C# on 6/5/2013 | Points: 10 | Views : 3096 | Status : [Member] | Replies : 1
Hi all,
I am generating report in Datagridview in c# windows application. i want to view that report in the range of two dates like(28/05/2013 12:00 AM to 31/05/2013 12:00 AM) using Dataview.RowFilter. please give some idea, how can i get the result. Thanks in advance.......

Bagesh Kumar Singh

Bagesh Kumar Singh
Mark as answer if you have been satisfied


Posted by: Nadeemshaik on: 7/3/2013 [Member] Starter | Points: 25

like this you can filter the records From date to To Date

dv.RowFilter = string.Format("(Created_On>='{0}' and Created_On<='{1}')", DtpDateRangeFrom.Value.ToShortDateString(), DtpDateRangeTo.Value.ToShortDateString());

Bageshkumarbagi, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response