1
I have a problem when I go to save the data of fields currency
or decimal
in an Access database using Visual Studio components.
When I save something like 1.99m
or has 1,99
in the textbox the data goes to the database as 199
. In short the comma is removed and I get the values multiplied by 100. How can I fix this? I’ve tried things like decimal.parse
and Convert.toDecimal
in addition to playing directly the dice in querys that I created:
tableAdapterprodutosTableAdapter.UpdateEstoquePreco(id, **1.99m**);
The problem occurs in any operation both insert
how much in update
.
What is the date type of the variable that receives this value (currency)?
– Premiere
Decimal I’m doing a test right now with a Double but by default is Decimal
– Juliano
Searching I found the following material, but as I used the tableAdapter components and datasets throughout the system I can’t apply it! but follows the code!
– Juliano
You commented that you tried with 1.99 too... if you go straight to the bank and enter 1.99 it accepts?
– Premiere
Yes in the bank all right including with those commands I put below in the answer too, what I realized eh that there seems to be a certain incompatibility with the access and the components of the visual studio (dataset, Datatableadapter) finally those that you create automatically by dragging the elements from the datasource to the form, but as I said... it seems because it is only with the floating point numeric fields that I am having problems I tried to change to Double but in the same!
– Juliano