Vuk Stanojevic

Vuk Stanojevic

  • 1.6k
  • 140
  • 45.6k

Convert string to Decimal insert to DB

Jul 31 2022 8:36 PM

Hi, everyone.

I have a form which when i open load data from DB to textboxes.

One text pox contain price which is at the moment of input in textbox converted to string at it looks OK (for example 119,56).

But after i change this 119,56 string and i want to update this chage in DB for example to 220,45 it update it in DB as 22045,00.

To update this value in DB i use following sqlcommand: "Update Offer set UnitPrice= Convert.ToDecima(textboxt.text)".

So i'm not sure why 220,45 string which i convert to decimal appears in DB like 22045,00.

Also, column where i want to update it is configured as type Decimal (18,2).

Some advice?

Thank you.

 


Answers (1)