c# datatable select statement with dates

后端 未结 5 1335
难免孤独
难免孤独 2021-01-12 06:16

i am trying to make a select statement on a datatable to get the row that is within the date range i am looking for. I am new to this an i dont quite understand how this sel

5条回答
  •  心在旅途
    2021-01-12 06:34

    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.

提交回复
热议问题