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
Post a Comment