Clear the doubt

Closed
siva - Feb 11, 2010 at 09:49 AM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Feb 11, 2010 at 09:58 AM
Hello,

SqlConnection cn=new SqlConnection("data source=COMPUTER-CBC14A\SQLEXPRESS;Initial catalog=siva");
cn.Open()
SqlCommand cmd=cn.CreateCommand();
cmd.CommandType=CommandType.Text;
cmd.CommandText="insert into siva1 values('+TextBox1.Text')";
cmd.ExecuteNonQuery();
cn.Close();
i got this error Unrecognized escape sequence

1 response

rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
Feb 11, 2010 at 09:58 AM
try this
SqlConnection cn=new SqlConnection("data source=COMPUTER-CBC14A\\SQLEXPRESS;Initial catalog=siva");
0