In MS Access Database
Insert query to insert the character——> N’tetarnyl
I have an insert query
OleDbCommand cmd = new OleDbCommand("insert into checking values('" + _
dsGetData.Tables[0].Rows[i][0].ToString() + "','" + _
dsGetData.Tables[0].Rows[i][1].ToString()+ "')", con);
but it is showing me error…
syntax error (missing operator) in query expression
any idea??? How can I write insert query to insert the N’tetarnyl (including apostrophe)
You have to escape your ‘ by writing it twice. The easiest way of doing that is
YourString.Replace("'", "''")