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

apache - setting document root in antoher partition on ubuntu -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -

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