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
Take the current value of the U_G_Studio
field, add the value of the parameter and reassign to U_G_Studio
, but keep in mind that you need to pass the value as an integer because otherwise the AddWithValue
will pass a string and you get conversion errors coming from the db.
cmd = New SqlCommand("UPDATE PersonsA SET U_G_Studio=U_G_Studio + @ugpoints " &
"WHERE Members_ID=@recevierID", con)
cmd.Parameters.AddWithValue("@recevierID", tranmemberID.Text)
cmd.Parameters.AddWithValue("@ugpoints", Convert.ToInt32(tranamount.Text))
cmd.ExecuteNonQuery()