Hi to all:
This peace of code put one value in DB:
I had run the code step by step and he do a strange,better, very strange thing...Code:Dim con1 As New OleDb.OleDbConnection(String.Format("PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source = " & drive & IDempresa)) Dim sSQL As String valorcolocardebito = FormatNumber(valorcolocardebito, 2) If valorcolocardebito = 0 Then valorcolocardebito = 0 End If sSQL = "UPDATE balancetegeral SET numeroconta = @contaacolocar, " sSQL = sSQL & "mensaisdebito = @valorcolocardebito " sSQL = sSQL & "WHERE numeroconta = @contaacolocar" Dim command As New OleDb.OleDbCommand(sSQL, con1) With command.Parameters .AddWithValue("@contaacolocar", contaacolocar) If valorcolocardebito = 0 Then .AddWithValue("@mensaisdebito", DBNull.Value) Else .AddWithValue("@mensaisdebito", valorcolocardebito) End If End With con1.Open() command.ExecuteNonQuery() con1.Close()
The value puted in valorcolocardebito = 263.733,69 and when I confirm this value in DB i have 263.733,70...
More surprise is because he make this for an values and for other save very well...
This could be surealistic,but it is that I have and sincerely i don't know way this happen...
Can anyone give me an suggestion?
Thanks




Reply With Quote