c# - asp.net inserting data with " ' " causes exception -


i inserting data .mdf database through webpage. when insert words contain apostrophe " ' ", causes exception. tried escape \' inserts whole " \' ". don't want insert these directly database table through visual studio because need date.now time/date inserted (through c#).

please show me how insert " ' " , other characters. in advance.

you can escape double apostrophe '', shouldn't use in sqlcommand text. add parameters using sqlcommand.parameters avoid sql injection possibility.


Comments

Popular posts from this blog

Process 'command 'F:\android-sdk\build-tools\21.1.2\aapt.exe'' finished with non-zero exit value 1 -

apache - setting document root in antoher partition on ubuntu -

java - Updating to mongo 3.0 -