Tuesday, December 12, 2006

ByteArray objects cannot be converted to strings

Here's the situation.

I have a "tb_customer" table which has a column named "address" of type Text in a MySQL database. I use tag named "getCustomer" to invoke simple SELECT query from within Coldfusion page. When I list all query result within a construct, I got this error:

"ByteArray objects cannot be converted to strings."

when the variables #address# that contains the value of "address" column is processed. My first response to it was to look around and see what ByteArray object is in Coldfusion. Trying with no luck, I then thought it must have something to do with typecasting. Simply enclosing #address# variable as an argument of ToString function, like this one

#ToString(address)#

would do the trick.

2 comments:

jersey joe said...

Thanks for posting this, this helped me!!!

Prabhakaran said...

Thanks... It works...
-Prabha
http://bookmox.com