Click here to Skip to main content
15,890,438 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to filter a single date column with start date and end date in a datatable?

Preferentially using dataview
Posted
Updated 3-Mar-14 23:56pm
v2
Comments
Ramug10 4-Mar-14 6:06am    
Not at all clear, are you want to filter datatable by date with in startdate and enddate columns

1 solution

This is the solution. Try this
string filter = " (Date >= #" +
         Convert.ToDateTime(txtStartDate.Text).ToString("MM/dd/yyyy") +
         "# And Date <= #" +
         Convert.ToDateTime(txtEndDate.Text).ToString("MM/dd/yyyy") +
         "# ) ";

DataView dvFormula = dsFormula.Tables[0].DefaultView;
dvFormula.RowFilter = filter ;
 
Share this answer
 
Comments
Member 10517120 5-Mar-14 1:35am    
Thank u ramu g

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900