c# datatable select statement with dates

This the Best Optimal Search Criteria I have Tested. you having to dates.

From_Date = 12/01/2012 To_Date = 12/31/2012

and Your column in DataTable upon which you applying . (in my code 'date')

Your Select Statement will be like this.

  DataRow[] rows = newTable.Select("date >= #" + from_date + "# AND date <= #" + to_date + "#");

Besides wrapping your dates with #, if date1 is a DateTime and not a string, you need to use the ToString(your date format) to get the correct sql statement. For debugging it make it easier if first you create a string containing your filter, then do the select using that string. Then you can look at the string and use that in the query builder to validate your sql.