Bug #26621 The MySQLDataAdapter change the type of a MySQL bit to a System.UInt64
Submitted: 25 Feb 2007 18:37 Modified: 12 Mar 2007 19:21
Reporter: Christian Alejandro Sandoval Diaz Email Updates:
Status: Not a Bug Impact on me:
Category:MySQL Visual Studio Plugin Severity:S3 (Non-critical)
Version:1.1 OS:Windows (Windows XP)
Assigned to: CPU Architecture:Any
Tags: bit, MySqlDataAdapter, Uint64

[25 Feb 2007 18:37] Christian Alejandro Sandoval Diaz
the return type of value from a field in a query passed to a MySQLDataAdapter  is wrong when the MySQL type of the field is "bit(1)"

How to repeat:
this is the SQL script:

CREATE TABLE test(field1 bit);

this is the c# .NET code:

string SQL;
MySqlCommand Com = new MySqlCommand();
MySqlDataAdapter Adap = new MySqlDataAdapter(Com);
DataTable table = new DataTable();
Com.Conection = this.Conection;

SQL = "SELECT field1 FROM test";
Com.Command = SQL;

//there the value of tabla.Rows[0]["field1"].GetType().FullName 
//is "System.UInt64" instead of "System.Boolean"

Suggested fix:
I think that is a problem with the Conversión, I need a return type of "System.Boolean" or "bool", because i am doing a migration of a application from MS SQL Server to MySQL Server, the MS SQL Server returns the the type that i need.

I know that i can simply make a conversion from UInt64 to bool, but this is a bug.
[12 Mar 2007 19:21] Tonci Grgin
Hi Christian and thanks for your report. 
I don't quite get it... Can you please read http://dev.mysql.com/doc/refman/5.0/en/bit-field-values.html again.