I normally add the text as a parameter. Example:
private void testToolStripMenuItem_Click(object sender, EventArgs e)
{
string text = @"This text ""contains"" double quotes";
InsertText(text);
}
private void InsertText(string textToInsert)
{
string query = "INSERT INTO MyTextTable (StoredText) VALUES (@TextToInsert)";
using (SqlConnection conn = new SqlConnection("your sql connection string"))
{
conn.Open();
using (SqlCommand com = new SqlCommand(query, conn))
{
com.Parameters.AddWithValue("@TextToInsert", textToInsert);
com.ExecuteNonQuery();
}
}
}