VB.NET - Insert Query issue with textbox and apostrophe
Posted on 2010-08-31
Not sure how to go about this, but I created a windows application that has a richtextbox. Behind code will insert whatever that is typed in this richtextbox to a SQL Server 2005 database table. It works fine, but when a comma is use, it gives me an error.
John's car was stolen.
Above example thinks that the apostrophe is the closing. So if I look from code behind, my syntax query would look like the following:
Insert into Table1(ID, Description)
Values(1, 'John's car was stolen')