Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

.Net DbType for MySql Column of Int(11)

Status
Not open for further replies.

Auguy

Programmer
May 1, 2004
1,206
US
The MySql column Physician is Int(11). What should be the DbType in the following statement? Int24,32,..?
Code:
command.Parameters.Add("@PhysicianPK", MySqlDbType.Int24, "PhysicianPK")

Auguy
Sylvania/Toledo Ohio
 
Here's another issue. Trying to use MySql TinyInt in a checkbox in a datagridview. Works ok if checked, but if unchecked it does not go to zero, but to nothing and causes update to fail with a cannot be null error. I used TinyInt after trying the Bit(1) in MySql. Here is code for column setup in the Update command. I also tried Int16
Code:
      command.Parameters.Add("@IsPremier", MySqlDbType.Bit, 4, "IsPremier")

Auguy
Sylvania/Toledo Ohio
 
I solved this latest issue by looping thru the table and changing empty values to 0. That seems like a bad hack.

Auguy
Sylvania/Toledo Ohio
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top