PC Review


Reply
Thread Tools Rate Thread

Datatable.Select on custom type column

 
 
Stephan Steiner
Guest
Posts: n/a
 
      23rd Nov 2007
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


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How Can I Use DataTable.Select() on a field of type byte[]? Leon_Amirreza Microsoft ADO .NET 1 2nd Mar 2009 07:32 AM
Re: What type should I set the dataTable column to for byte[] type of Morten Wennevik [C# MVP] Microsoft C# .NET 2 18th Jan 2007 03:07 PM
Datatable.Select and datetime type MichalR Microsoft ADO .NET 2 25th Aug 2004 09:02 AM
How to select column from a datatable =?Utf-8?B?Q2h1bmc=?= Microsoft ADO .NET 3 17th May 2004 01:58 PM
DataTable.Select with object reference type Lynn Kear-Noe Microsoft Dot NET Compact Framework 1 18th Jul 2003 03:49 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:20 PM.