Print Page | Close Window

SByte to Bool

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=2409
Printed Date: 14-Jul-2026 at 3:11am


Topic: SByte to Bool
Posted By: gregweb
Subject: SByte to Bool
Date Posted: 30-Dec-2010 at 2:37pm
I have a MySQL database with a bit field to hold a boolean value.  In SqlServer, these normally come through on the Entity as boolean values.  With MySQL, it comes through as an SByte.
 
I know I can use value converters to convert it to a bool, but is there a better way to do this so it's a bool on the Entity?
 
Greg



Replies:
Posted By: kimj
Date Posted: 30-Dec-2010 at 3:04pm
The mapping is actually determined by your EF provider, although you can override it by modifying the EDMX directly (either through the designer or the XML). 
 
If you're using DevArt's MySQL provider, here's the default mappings:  http://www.devart.com/dotconnect/mysql/docs/DataTypeMapping.html - http://www.devart.com/dotconnect/mysql/docs/DataTypeMapping.html


Posted By: gregweb
Date Posted: 31-Dec-2010 at 8:07pm
Great thanks, this is now resolved.
 
Greg



Print Page | Close Window