Split from - http://www.daniweb.com/forums/thread94883.html
hi i have the button click event
protected void Button1_Click(object sender, EventArgs e)
{
SqlConnection myConn = new SqlConnection();
myConn.ConnectionString = "Data Source=.\SQLEXPRESS;AttachDbFilename=D:\Postmyadd\App_Data\postmyad.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True";
myConn.Open();
string strqry = "Insert into advertisements values (" + TextBox1.Text +")";
SqlCommand myCom = new SqlCommand(strqry, myConn);
int numrow = myCom.ExecuteNonQuery();
myConn.Close();
}
but when i bebug i get the error saying unrecognized escape sequence '\'.