Hi,
I have a dataview with a DATE column which is in Date format (not string)
I have a datetimepicker.
The user selects a date from the datetimepicker.
I want to rowfilter the dataview, so that all rows which have a Date, later than
the selected datetimepicker date, are displayed.
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
Unlimited question asking, solutions, articles and more.
lossiemouth
ASKER
If I select 16 Feb 2010 on the datetimepicker
This is the exception
System.InvalidCastException was unhandled
Message="Conversion from string "02/16/2010" to type 'Date' is not valid."
pradyahuja
works fine on my machine.
try changing date to 02/02/2010
lossiemouth
ASKER
The dataview Date column format is yyyy-mm-dd
So, I try to change the datetimepicker format to match the dataview
myDate = DateTimePicker1.Value.Date
myDate = myDate.ToString("yyyy-MM-dd")
When I run this code, myDate = #2/2/2010#
I was hoping for 2010-02-02
However, I could be wrong, but I don't think it would work anyway. because I am now trying to
use a string to rowfilter a Date column.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
The Dataview is taken from a XML table. The date format is YYYY-MM-DD
The datetimepicker has a format of MM/DD/YYYY
This is causing problems with the filter.
Is there a way to change one of the formats, so that they match?
Lossie