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

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

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