Home All Groups Group Topic Archive Search About

Datatable.Select on custom type column

Author
23 Nov 2007 2:37 PM
Stephan Steiner
Hi

Is there a way to do a select where the selection criteria is on a column of
a custom data type.

E.g. if the table column is defined

DataColun column = new DataColumn("Task", System.Type.GetType("Task"));

And the select would be something like

Task myTask = new Task();
DataRow[] rows = DataTable.Select("Task = " + myTask);

What happens if I do this is I get an error telling me
Missing operand after 'Meeting' operator

which makes no sense. However, I think what the runtime is trying to tell me
is that it doesn't know what to do with my selection criteria since it's not
a built-in type.

Is there a way to still make the query work or will I have to loop over the
data?

Regards
Stephan

AddThis Social Bookmark Button