I have this piece of code
Dim lt As Decimal
Dim lg As Decimal
Decimal.TryParse(tbLat.Value.Replace(".", ","), lt)
Decimal.TryParse(tbLng.Value.Replace(".", ","), lg)
com.Parameters.AddWithValue("latitude", lt)
com.Parameters.AddWithValue("longtitude", lg)
in which I am trying to store the lt and lg parameters in column decimal(9,6).
In the local SQL Server it worked fine, but when I deployed in to my web server it gave me this error
Arithmetic overflow error converting numeric to data type numeric. The statement has been terminated.
I decided to increase the precision to 16 so the column became decimal(16,6). Now it stores the whole number like that 25252525.000000!
Probably is matter of localize, but my question is how to avoid localization and store the number safely?
ok, after googling and trying I follow the example on http://msdn.microsoft.com/en-us/library/ew0seb73.aspx and that drives me in the code:
which worked in both local and web.
Thanks everyone who tried to help!