Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27360

VS 2010 Need help with update command

$
0
0
I am try to update some records on a database using the following commands



Dim command As New SqlCommand("UPDATE Itemcodes SET SalePrice = '" & SellPrice & "' WHERE ItemCode = '" & CodeAN & "'", connection)
command.ExecuteNonQuery()

both SalePrice and CodeAN are String variables but when I debug my code the execute command is as follows

"UPDATE Itemcodes SET SalePrice = '' WHERE ItemCode = ''"



SalePrice has a value of 250 and CodeAn = E00003

Why can't I get the values to appear in the command line?

Viewing all articles
Browse latest Browse all 27360

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>