I have a C# form application which is linked to an SQL server database. The application relays queries to the SQL server and inputs/outputs data accordingly.
An error which came up is when I am trying to input a string which has an apostrophe in it like for example inputting "The dog's bone"
.
Is there any way to input this since I cannot ask the user to always enter a double apostrophe as many people suggest.
This is my query which I am inputting:
Query = "INSERT INTO " + databaseNotes + " VALUES ('" + Release_Desc_txtBox.Text + "')";
constring = "Password=" + pass + ";Persist Security Info=True;User ID=" + user + ";Initial Catalog=" + catalog + ";Data Source=" + datasource;
// CONNECTION TO SQL SERVER DATABASE
SqlConnection conDataBase = new SqlConnection(constring);
SqlCommand cmdDataBase = new SqlCommand(Query, conDataBase);
SqlDataReader myReader;