Home All Groups Group Topic Archive Search About
Author
9 Aug 2006 6:48 PM
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

Author
9 Aug 2006 7:19 PM
Miha Markic [MVP C#]
Hi Thomas,

Why do you have a byte array data type for second column?

--
Miha Markic [MVP C#, INETA Country Leader for Slovenia]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

Show quote
"Thomas Kehl" <t.kehl (at) heeb.com> wrote in message
news:44da2dfe$1_2@news.bluewin.ch...
> 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
>
Author
9 Aug 2006 9:36 PM
Shawn Wildermuth (C# MVP)
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

Show quote
> 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
Author
10 Aug 2006 8:36 AM
Cor Ligthert [MVP]
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

Show quote
"Thomas Kehl" <t.kehl (at) heeb.com> schreef in bericht
news:44da2dfe$1_2@news.bluewin.ch...
> 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
>

AddThis Social Bookmark Button