kritika Rana

kritika Rana

  • NA
  • 252
  • 100.9k

asp.net connectivity with sql server 2008

May 22 2013 1:19 AM
Hi

I am trying to establish a connection between asp.net and sql server using C# connection string but it shows error that the file name is not specified

My code is like this:

    SqlConnection con = new SqlConnection("data source=MYserver;initial catalog=master;integrated security=true");
   con.Open();
  SqlCommand cmd = new SqlCommand("insert into sqldb values("+textBox1.Text+",'"+ textBox2.Text+"',"+textBox3.Text+",'"+textBox4.Text+"')",con);
  cmd.ExecuteNonQuery();
  con.Close();

Help me in solving the problem

Thanks

Answers (2)