Strings returned as Byte[]

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
Post Reply
joy87
Posts: 2
Joined: Fri 10 Feb 2012 09:24

Strings returned as Byte[]

Post by joy87 » Wed 11 Apr 2012 20:37

i'm using mysql connector version 6.6 and mysql server 5.5.
earlier when i was using the older versions of mysql and devart connector string was returned from db as string but when i updated both the string is now returned as Byte[].
Can u tell me what the issue is??

Shalex
Site Admin
Posts: 8247
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Thu 12 Apr 2012 09:39

We have answered you by e-mail.

Chunki
Posts: 1
Joined: Wed 09 May 2012 06:52

Re: Strings returned as Byte[]

Post by Chunki » Wed 09 May 2012 07:02

same issue here, though I use MySQL 5.1 and dotConnect for MySQL 6.80.350. Could you tell me why does it happen, and how to fix it?

Pinturiccio
Devart Team
Posts: 2192
Joined: Wed 02 Nov 2011 09:44

Re: Strings returned as Byte[]

Post by Pinturiccio » Fri 11 May 2012 08:39

Chunki wrote:Could you tell me why does it happen, and how to fix it?
It was done to add a possibility to convert byte array to a string with a needed encoding, not only with the default one.
We have implemented a new public static class OldCompatibility starting from the 5.80.190 build of dotConnect for MySQL. Please use it in the following way to obtain the previous behaviour ( binary (MySQL) -> string (.NET)):

Code: Select all

OldCompatibility.BinaryAsString = true;
MySqlConnection conn = new MySqlConnection("User id=root;pwd=root;port=3306;host=localhost;database=test");
conn.Open();

Post Reply