using System; using System.Collections.Generic; using System.Text; using System.Data; using System.Data.Odbc; using MySql.Data.MySqlClient; namespace unsigned_int_sample { class Program { static void Main(string[] args) { Console.WriteLine("This Works"); NativeProvider(); Console.WriteLine(); Console.WriteLine("This is wrong"); ODBCProvider(); Console.ReadLine(); } private static void NativeProvider() { MySqlConnection conn = new MySqlConnection("SERVER=localhost;DATABASE=test;UID=test;PWD=test;"); MySqlCommand cmd = new MySqlCommand("SELECT someuint FROM test_table", conn); object temp = null; conn.Open(); using (MySqlDataReader mdr = cmd.ExecuteReader(CommandBehavior.CloseConnection)) { while (mdr.Read()) { temp = mdr["someuint"]; Console.WriteLine(temp.ToString() + " - " + temp.GetType()); } } } private static void ODBCProvider() { OdbcConnection conn = new OdbcConnection("DRIVER=MySQL ODBC 5.1 Driver;UID=test;PWD=test;PORT=3306;DATABASE=test;SERVER=localhost;"); OdbcCommand cmd = new OdbcCommand("SELECT someuint FROM test_table", conn); object temp = null; conn.Open(); using (OdbcDataReader odr = cmd.ExecuteReader(CommandBehavior.CloseConnection)) { while (odr.Read()) { temp = odr["someuint"]; Console.WriteLine(temp.ToString() + " - " + temp.GetType()); } } } } }