Page 1 of 1

tinyint mapping

Posted: Fri 11 Mar 2011 13:09
by dilbert
I just want to ask if it is convenient to map TINYINT (in Mysql) to System.Byte by default.

TINYINT can contain negative vaules and Byte is usigned in C# (0-255). So, the following exception is raised in such cases:

Code: Select all

MESSAGE: Value was either too large or too small for an unsigned byte.
STACKTRACE:    at System.Byte.Parse(String s, NumberStyles style, NumberFormatInfo info)
   at Devart.Common.ap.ar(Byte[] A_0, Int32 A_1, Int32 A_2)
   at lambda_method(ExecutionScope , b )
   at Devart.Data.Linq.Provider.ObjectReader`1.g()
...

Posted: Fri 11 Mar 2011 17:16
by StanislavK
Thank you for the request, we've changed the default mapping for signed TinyInt to System.SByte. We will post here when the build with this change is available.

Posted: Thu 24 Mar 2011 14:44
by StanislavK
We have released the new 6.10.126 build of dotConnect for MySQL where this issue is fixed. The new build can be downloaded from
http://www.devart.com/dotconnect/mysql/download.html
(the trial version) or from Registered Users' Area (for users with active subscription only):
http://secure.devart.com/

For more information about the fixes and improvements available in dotConnect for MySQL 6.10.126, please refer to
http://www.devart.com/forums/viewtopic.php?t=20585

Posted: Fri 10 Jun 2011 09:18
by Miros
StanislavK wrote:We have released the new 6.10.126 build of dotConnect for MySQL where this issue is fixed. The new build can be downloaded from
http://www.devart.com/dotconnect/mysql/download.html
(the trial version) or from Registered Users' Area (for users with active subscription only):
http://secure.devart.com/

For more information about the fixes and improvements available in dotConnect for MySQL 6.10.126, please refer to
http://www.devart.com/forums/viewtopic.php?t=20585
Hi there, it seems that this error is back in dotConnect for MySQL Pro v. 6.30.165 - I am getting this error with records having Tinyint = -1.