0

I use a SQLDataAdapter to select/update/insert data from/to a table in MS SQL Server (.NET Framework 4.0 as client framework). The UpdateCommand in the SQLDataAdapter needs 2 float parameters, which I add like this:

With _sqlDA_Prot_Points.UpdateCommand
.Parameters.Add(New SqlParameter("@Alm_PLUS", SqlDbType.Float, 1, "Alm_PLUS"))
.Parameters.Add(New SqlParameter("@Alm_MINUS", SqlDbType.Float, 1, "Alm_MINUS"))
end with

My regional settings are it-IT. When the DataAdapter tries to update my DataTable changed rows to the server, the Float parameters in the SQLServer Profiler show up with a "," instead of a "." as decimal separator, causing an exception. I found no way to tell the DataAdapter how to convert the double to a string using the "." instead of the ",".

Any idea?

Thank you in advance

user1737538
  • 497
  • 2
  • 7
  • 16
  • Can you post the exception? – Khan Sep 24 '13 at 15:40
  • How do you set the values of the parameters? It sounds like you are using strings instead of floats. – Jakob Christensen Sep 24 '13 at 15:49
  • Today, I don't Know why - nothing changed, only reboot, I am getting no exception at all. But SQL Server Profiler is still showing up paramters formatted like **@Alm_PLUS=2,0823981761932284**. If I run the same query in Management Studio I get the error _Must pass parameter number 5 and subsequent parameters as '@name = value'. After the form '@name = value' has been used, all subsequent parameters must be passed in the form '@name = value'_ This is due to the "," used by the DataAdapter to format my Double number – user1737538 Sep 25 '13 at 07:53

0 Answers0