SQL Update Column By Adding A Number To Current Int

前端 未结 4 1588
一生所求
一生所求 2021-01-22 00:39

Simple enough, I can\'t figure out how to add (that\'s +) an integer from a textbox to the integer in the SQL Field.

So for example, the SQL Field may have \'10\' in it

4条回答
  •  迷失自我
    2021-01-22 01:00

    what about

    cmd.Parameters.AddWithValue("@ugpoints",  (int)tranamount.Text) 
    ....
    cmd = New SqlCommand("UPDATE PersonsA SET U_G_Studio= SET U_G_Studio + @ugpoints WHERE Members_ID=@recevierID", con)
    

    edit1: STEVE WAS FASTER!

提交回复
热议问题