Home All Groups Group Topic Archive Search About

How to use DataView class's RowFilter property to filter for DateT

Author
24 Feb 2006 9:55 AM
MarcAlbaum
Hi!

I use a DataTable with a string and a DateTime column as primary key. Now I
want to wrap a DataView around that table and filter for a certain column. I
want to use the RowFilter property. Something like this:

DataTable myTable = new DataTable();
myTable.Columns.Add( "MyDate", typeof( DateTime ) );
DataView myView = new DataView( myTable );
myView.RowFilter = "MyDate = #12/31/2005 23:59:59#";

That datetime format string I used in the last line is wrong. Does anybody
know the correct format string in form of "#MM/dd/yyyy HH:mm:ss#"?

Best regards

Marc

AddThis Social Bookmark Button