I have the following Code in C# ( Sql server (LocalDB)\v11.0) If Definition property has no special character , the Insert executed. but some times it has an unknown special character in it , and i recive the Error.
for()
{
if(){
DB.Docommand("INSERT INTO Test5(P_Def) VALUES('"+ pro.Definition + "')");
}
}
in database the data type is nvarchar(Max) but i receive the following error:
incorrect syntax near .....
I want to insert my property with special characters. What can id do? Thanks