Problems with Access DB and fields of type Decimal

G

Guest

I have an Access 2000 database with a table that has a field of type
'Decimal'. Precision = 5, number of decimal places = 2

My VB.NET application (FrameWork 1.1 SP1) has a strongly-typed DataSet for
this database. The field within my DataSet is of type Decimal. I also have a
DataAdapter to update my Access database table. The parameter of the
DataAdapter's Update Command is of type OleDbType.Decimal with Precision=5
and Scale=2

When I update my database with a value of let's say 6.78 it stores 678
instead of 6.78
If I reload the values from the database into the DataSet by using the
DataAdapter I get 678. I also tried to switch the parameter type from
OleDbType.Decimal to OleDbType.Numeric without success.

I have a Microsoft database and a Microsoft Development Environment and a
Microsoft wizard generated the code for this. The result: it does not work.
What's going on?
 
G

Guest

Some further testing revealed the following:
The problem exists if you use a decimal separator character other than '.'
Since I have a German Windows I have ',' as decimal separator and '.' as
thousand separator. If I switch these two by using Windows control panel then
my application works as expected (i.e. a number 6.78 is stored as 6.78 and
not as 678). Obviously there is some kind of localization bug in the .NET
Framework.

Guido
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top