Click here to Skip to main content
15,895,557 members

apostrophe s problem in sql query

Revision 1
i have comment textbox.And it is working perfectly.when i enter text in textbox of comment data inserted sucessfully in database table.But if i use 's in writing comment in textbox,it will give me error.I know perfectly that it is error because of 's.what coding is require to solve this problem?


SqlCommand cmd = new SqlCommand("insert into table (name,address,comment) values('" + txtname.text + "','" + txtaddress.text + "','"+txtcomment.text+"')", cnn);
Posted 18-Jan-13 19:11pm by Member 9511889.
Tags: ,