Hi,
I've got several fields where I need to save fixed length numeric only data. I followed the mysql recommendation and created these fields as f.ex int(4) unsigned zerofill for a 4 digit numeric field. I tried filling a typed dataset table with this column with a value of 0012 in db. The value when using datatable column type to System.int32 leaves a 12 in the dataset, if setting dataset column type to System.String it still gives me a value of 12, not 0012 as I would expect.
I had to revert to using char(4) in the database for this to work. What is the reason the int(4) unsigned zerofill doesn't work when reading it from db to a datatable in a typed dataset? Is it dotConnect or the DataSet design that is to blame?
Zerofill columns
This is a designed behaviour. Please use the select statement in the typed Devart DataSet as follows:
The result column from this select statement will be mapped to System.String and will show 0012.
Code: Select all
SELECT cast(int4column as char(4)) FROM mytable