Mysql Type Enumeration - Passing Unsigned Int

Mysql Type Enumeration - Passing Unsigned Int

Postby ganesan » Wed 27 Jan 2010 12:19

I am trying to pass a very long integer stored as unsigned int in Database. The integer value is greater than the limit of Signed Integer. Is there any way of passing a parameter and tell that it is unsigned integer. The documentation does not provide a way to specify unsigned int

Thanks
ganesan
 
Posts: 1
Joined: Wed 27 Jan 2010 12:12

Postby StanislavK » Wed 27 Jan 2010 14:28

MySqlType.BigInt represents both signed and unsigned 64-bit integers. The code for inserting an unsigned integer to the database should look like the following:

Code: Select all
UInt64 Int = UInt64.MaxValue;
MySqlCommand command = new MySqlCommand("Insert into UInt_Table values (?)", mySqlConnection1);
command.Parameters.Add("param1",Int);
command.ExecuteNonQuery();
StanislavK
Devart Team
 
Posts: 1710
Joined: Thu 03 Dec 2009 10:48


Return to dotConnect for MySQL