Tinyint(1) maps to Int16
Posted: Thu 21 Dec 2006 17:31
Many of my tables have TinyInt(1) columns. MySQLDirect maps this type to the CTS Int16 type.
I use the VS2005 DataSet Designer and GridViews in my projects. When I have a TinyInt(1) column in a table I want that it to appear as a Checkbox in my GridViews. To do this I change the DataType from Int16 to TinyInt(1) for the column in the DataSet designer, and it then automatically appears as a Checkbox. This works fine. The problem is if I make any changes to the TableAdaptor, such as adding a column, then the designer automatically adds a new column, naming it [originalcolumnname]1 with type Int16. It also unbinds the old column. I have to play around with the columns until I get it back to the way I want it. This is very time consuming, and frustrating.
My questions are:
(1) Is it possible to have TinyInt(1) columns automatically mapped to the Boolean type?
(2) If not, is there a way around what I am doing?
I could keep the column as Int16, and make the adjustments at the GridView level. But, it effectively causes me the same problem and takes even more time. If I refresh the DataSource schema of the GridView then I will have to convert the column to a checkbox again.
Any help would be greatly appreciated. Many thanks.
I use the VS2005 DataSet Designer and GridViews in my projects. When I have a TinyInt(1) column in a table I want that it to appear as a Checkbox in my GridViews. To do this I change the DataType from Int16 to TinyInt(1) for the column in the DataSet designer, and it then automatically appears as a Checkbox. This works fine. The problem is if I make any changes to the TableAdaptor, such as adding a column, then the designer automatically adds a new column, naming it [originalcolumnname]1 with type Int16. It also unbinds the old column. I have to play around with the columns until I get it back to the way I want it. This is very time consuming, and frustrating.
My questions are:
(1) Is it possible to have TinyInt(1) columns automatically mapped to the Boolean type?
(2) If not, is there a way around what I am doing?
I could keep the column as Int16, and make the adjustments at the GridView level. But, it effectively causes me the same problem and takes even more time. If I refresh the DataSource schema of the GridView then I will have to convert the column to a checkbox again.
Any help would be greatly appreciated. Many thanks.