David Chen

David Chen

  • NA
  • 50
  • 45.7k

C# & MySQL & SQL

Aug 14 2011 7:14 PM
Hi All, I have a problem

I have a MySQL Table, one of the columns' Data Type is TinyInt(1)

When I use this line of code it gives an error

int newNumber = int.Parse(string.Format("{0}", reader["someField"]));

I think the reader is reading a bool value

however MySQL Table has row values of 0 & 1 & 6 & 7

so it is not bool true/false type

How can I actually grab that value to store into "int newNumber"

Thanks

Answers (19)