Talk2Tom11 Posted March 10, 2007 Posted March 10, 2007 When i go to update a record using VB.net for a database in access I am getting the following error... "Argument 'Prompt' cannot be converted to type 'String'." when my SQL statement is as follows it works fine... SQL = "UPDATE Products SET TotalAmount = 1234 WHERE ProductName= ' " + cbocCat.text + " ' " But i want to replace the totalAmount with a variable from the form. So i changed the SQL statement to the following... SQL = "UPDATE Products SET TotalAmount =" + txtAmount.text + "WHERE ProductName= ' " + cbocCat.text + " ' " I was wondering if anyone knew why I am receiving this error. If anyone has and Idea place post. Quote
Administrators PlausiblyDamp Posted March 10, 2007 Administrators Posted March 10, 2007 Have you tried using a parameterised query rather than string concatenation to see if that fixes the problem? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Talk2Tom11 Posted March 10, 2007 Author Posted March 10, 2007 Have you tried using a parameterised query rather than string concatenation to see if that fixes the problem? How would I go about that? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.