I want to add a value to a field that has value from before. My code is:
Dim Credits As Integer = Int64.Parse(FinalPay.ToString)
Dim cmd As New SqlCommand("Update Users Set Credit=Credit+" + Credits +
" Where Email ='" + UserEmail + "'", con)
But I get an error that says:
"Conversion from string to double is not valid"
Dim Credits As Integer = Int64.Parse(FinalPay.ToString)
Dim cmd As New SqlCommand("Update Users Set Credit=Credit+" & Credits &
" Where Email ='" & UserEmail & "'", con)
When you want to concat a string in vb you want to use the "&" operator
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments