0

I have a VB.net web service that inserts data into a SQL 2008 DB. A lot of the data is being pulled from a word document. So we recently ran into an issue where smart quotes and a funky looking apostrophe was inserted into the data column. It inserted fine. My issue is that we are pulling the data from the DB and sending it back to the user as JSON. So when the user tries to look at the data they get an unexpected end of JSON when it tries to read the funky characters.

Can I do something in my VB code before I insert it or is it easier to do in the SQL insert stored procedure? Any suggestions would be greatly appreciated.

Dwight
  • 93
  • 1
  • 9
  • Escape the quotes with a backslash `\"` – Xaqron Apr 06 '17 at 14:21
  • The problem is that it is more than double quotes it could be a comma, an apostrophe, etc. I am not sure where the characters will be in the string either. – Dwight Apr 06 '17 at 15:09
  • Why would you have problem with commas? double-up the single quotes. – Xaqron Apr 06 '17 at 15:14
  • [This](http://stackoverflow.com/questions/5139770/escape-character-in-sql-server) is a general solution to your problem. – Xaqron Apr 06 '17 at 15:16

0 Answers0