المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : C# MySQL Question



C# Programming
08-15-2011, 03:31 AM
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