Hello how can i ignore a ' char in a sql query?
i want to put this into a table,"i can't work today."
but it gives this error "Incorrect syntax near 't'.
Unclosed quotation mark after the character string ')'."
please help :(
i want to put this into a table,"i can't work today."
but it gives this error "Incorrect syntax near 't'.
Unclosed quotation mark after the character string ')'."
please help :(
Code:
AppSettingsReader asr = new AppSettingsReader(); string conn = asr.GetValue("ConnectionString", typeof(System.String)).ToString(); SqlConnection sc = new SqlConnection(conn); sc.Open(); string query = "INSERT INTO Lang(lang)VALUES('" + "i can't work today." + "')"; SqlCommand command = new SqlCommand(query, sc); command.ExecuteNonQuery(); sc.Close();
Comment