Quantcast
Viewing all articles
Browse latest Browse all 12

Re: DataView RowFilter vs SQL WHERE

For some reason, this line does not like the StartDate and EndDate properties being used:

dvRowFilter.Append(String.Concat("(", ColName, " >= '", StartDate, "' and ", ColName, " < '", EndDate, "')"));

If I change it to:

dvRowFilter.Append(String.Concat("(", ColName, " >= '", DateTime.Now, "' and ", ColName, " < '", DateTime.Now, "')"));

It returns the expected number of rows (5).

I've tried using Convert.ToDateTime(StartDate), converting to date inside the property, etc. What do I need to do to get the property to return a datetime object?


Viewing all articles
Browse latest Browse all 12

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>