В адресном текстовом поле есть одинарные и двойные кавычки. Как я могу вставить в базу данных.Я использую SQL2005.Мой код выглядит следующим образом ...
str = "exec sp_cust_reg '" + customer.Cust_Id + "','" + customer.Cust_Name + "','" + customer.Gender + "','" + customer.Acc_no + "','" + customer.Address + "','" + customer.Pin_no + "','" + customer.Phone_no + "','" + customer.Mobile_no + "','" + customer.Email + "','" + customer.Authorise + "'";
Адрес - это дом jo 'hn
Текстовый визуализатор выглядит следующим образом ...
exec sp_cust_reg 'C7','George Joseph','Male','0001-212123','jo"hn's house','515151','04862787896','8888888888','johnyqw@gmail.com','N'
Я использовал
string sql = str.Replace("\'", " ");.
Тогда я получу
exec sp_cust_reg C7 , George Joseph , Male , 0001-212123 , jo"hn s house , 515151 , 04862787896 , 8888888888 , johnyqw@gmail.com , N