' operation on System.DateTime and System.Double" when applying a filter on DataView. ">

Cannot perform '>' operation on System.DateTime and System.Double

When you apply DataView1.RowFilter = "DateColumnName > " + DateValue, you get this error:
Cannot perform '>' operation on System.DateTime and System.Double

To use a Date value in a filter, you must use a pound "#" symbol around the date value like in the following:

dsView.RowFilter = "DateColumnName >= #" + DateTime.Today + "#";


Similar Articles
Mindcracker
Founded in 2003, Mindcracker is the authority in custom software development and innovation. We put best practices into action. We deliver solutions based on consumer and industry analysis.