updating a deciimal (sql in VB.Net)

  • Thread starter Thread starter Hyphessobricon
  • Start date Start date
H

Hyphessobricon

Hallo,

could you help with this problem?
Updating an integer, as tring ok, but a decimal ??
Update tblprice Set article = ' " & this & " ' WHERE ...
what signs do I have to put?
Thx for helping me
 
You should not use quotes (not single nor double) to update numeric values
in SQL.
Instead, leave the value "as is":
tmpSQL = "update MyTable set MyIntegerValue = " & MyInt & ", MyDecimalValue
= " & MyDec & ", MyStringValue = '" & MyString & "', MyBooleanValue = " &
CInt(MyBool)
I don't know if this is what you want. Let me know.
Hope this helps.
VBen.
 
VBen said:
You should not use quotes (not single nor double) to update numeric values
in SQL.
Instead, leave the value "as is":
tmpSQL = "update MyTable set MyIntegerValue = " & MyInt & ",
MyDecimalValue
= " & MyDec & ", MyStringValue = '" & MyString & "', MyBooleanValue = " &
CInt(MyBool)

.... and even better, use a parameterized '*Command' object instead of
inserting the values into the SQL command string by hand.
 
VBen said:
You should not use quotes (not single nor double) to update numeric values
in SQL.
Instead, leave the value "as is":
tmpSQL = "update MyTable set MyIntegerValue = " & MyInt & ",
MyDecimalValue
= " & MyDec & ", MyStringValue = '" & MyString & "', MyBooleanValue = " &
CInt(MyBool)
I don't know if this is what you want. Let me know.
Hope this helps.
VBen.

Hyphessobricon said:
Hallo,

could you help with this problem?
Updating an integer, as tring ok, but a decimal ??
Update tblprice Set article = ' " & this & " ' WHERE ...
what signs do I have to put?
Thx for helping me
That's exactly what I was looking for.
Thanks an awful lot VBen

a thankful Hyphessobrycon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top