SqlConnection con = new SqlConnection();
con.ConnectionString = @"Data Source = (LocalDB)MSSQLLocalDB; AttachDbFilename = C:UsersHarryDocumentsVisual Studio 2015WebSitesWebSite2App_DataDatabase.mdf; Integrated Security = True";
con.Open();
// insert command
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;
cmd.CommandText="INSERT INTO firsttb VALUES ( @n , @p ) ";
cmd.CommandType = System.Data.CommandType.Text;
cmd.Parameters.AddWithValue("@n",TextBox1.Text);
cmd.Parameters.AddWithValue("@p", TextBox2.Text);
cmd.ExecuteNonQuery();
con.Close();