When creating SQL statements, string values are delimited using apostrophes. So what happens when there is an apostrophe in the data you are trying to insert.
INSERT INTO DevASPtable (phrases) VALUES ('DevASP’s articles')
“DevASP’s articles” here u see there is a apostrophe in the string now it generate an syntax error due to this it crash your software. So how can you handle this problem using a simple command.
To insert an apostrophe into the database using SQL you need to "double-up" the apostrophes. That is, put two apostrophes in the text where you want just one. For example, to insert the phrase " DevASP’’s” articles into a database, the SQL code looks like:
INSERT INTO DevASPtable (phrases) VALUES (' DevASP’s articles ')
Now here is a simple command in VB.Net with which you can resolve this problem:
Dim str as String=“DevASP’s articles”
str.Replace(”’”,”’’”)
Now your string change into double apostrophes sign string mean DevASP’s articles
Note: This does not insert two apostrophes into the database