DataTable and Select

  • Thread starter Thread starter Thomas Kehl
  • Start date Start date
T

Thomas Kehl

Hello.

I have a DataTable which contains two columns (BEZEICH and PERSON_L).
BEZEICH is of the type string and PERSON_L of the type byte[] (Property
DataType of the columns). Now, I have to do a select on this Table. I try it
on the fallowing way:

oTable:Select("BEZEICH='test' and PERSON_L='1'")

When I do this, there will be a
System.Data.EvaluateException - The operation "=" cannot at system.byte[]
and system.string to be accomplished.

Can anybody help me, I does I have to write the select-Condition?

Thanks
Thomas
 
Hello Thomas Kehl" t.kehl (at) heeb.com,

Depending on the actual data type of PERSON_L, you might find that using
the CONVERT() function inside the expression will help. See the documentation
of the syntax on the DataColumn.Expression property for the complete syntax.
Like Miha said, the problem is likely to be why Person_L is a byte[] (perhaps
the database type is an image, varbinary or text field?) Converting it in
the expression might help but byte[] doesn't convert well in an expression.
Are you sure that byte[] is the data type you expected?

Thanks,
Shawn Wildermuth
Speaker, Author and C# MVP
http://adoguy.com
 
Thomas,

Maybe BEZEICH[0] = xx and BEZEICH[1] etc
where xx is the byte value will help, but as the others, I find this
strange,

Cor
 
Back
Top