Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
RowFilter and Dates
Message
 
 
To
24/05/2004 13:01:47
General information
Forum:
ASP.NET
Category:
ADO.NET
Miscellaneous
Thread ID:
00906425
Message ID:
00906600
Views:
23
Thanks Nancy, that explains it.

I am now using the following code.
AnimalsVw.RowFilter = "Dob <= '" + DateTime.Today.AddMonths(-18).ToString("yyyy-MM-dd") + "'";
I am using the compact framework. I don't think it supports the Console.WriteLine class which makes debugging a lot harder.

John


>John-
>
>>The data is read from an XML file (which is produces by VFP8 SP1 CursorToXML() function) using the DataSet.ReadXml class. When viewed in datagrid the date is displayed as 2004-5-24.
>>
>>I thought the data was a date type because if the column is sorted it is display in the correct date order.
>>
>>I have managed to get the filter working using the following
>>
>>
>>DateTime d = DateTime.Today.AddMonths(-18);
>>AnimalsVw.RowFilter = "Dob <= '" + d.ToString("yyyy/MM/dd") + "'";
>>
>>
>>If I included { or ^ from your example an error was returned when the code was run.
>
>Then the Dob is a string. My question was meant to prompt you to checking what data type you needed, which tells you the format. My syntax was using FoxPro date literal syntax...just habit if I'm making FoxPro date types. Anyway it helped you get to where you're going.
>
>I expect the sorting is working because of the formatting of the string, yes?
>
>>
>>I am a little puzzled why the value has to be converted to a string, if the Dob in the dataview is a date, or is the Dob column in the dataview stored as a string?
>
>Do you know how to check types of data in .NET? You can easily break your program and add a quick watch, for example.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform