views:

27

answers:

1

Programming in C#.NET. I have a DataTable with a column named Time which is of type System.TimeSpan. When I display the DataTable in a DataGridView I want to filter out all the entries that don't have a time listed. I have tried the following but to no avail. Can you help?

DataView myDataView = new DataView(SomeDataTable);
myDataView.RowFilter += "Time >= 1";  // doesn't work
myDataView.RowFilter += "Time >= #00:00:01#";  // doesn't work
myDataView.RowFilter += "Time <> ''";  // doesn't work
myDataView.RowFilter += "Time <> ''";  // doesn't work
A: 

I found it...

myDataView.RowFilter = "Convert(Time, System.String) <> ''";
Jordan S