title: Multiple Insert transaction connection timeout - ADO.NET - SQL Server
body: <p>I have a transaction with multiple inserts. All of the inserts work fine, except one.
  I verified the parameters, the spelling, all of it, and it seems I'm not figuring it out.
  It gives me the error: </p>
  
  <pre><code>Timeout expired. The timeout period elapsed prior to completion of the operation 
  or the server is not responding.
  </code></pre>
  
  <p>My transaction looks like this:</p>
  
  <pre><code>SqlConnection db = new SqlConnection(connString);
  DataSet dataSet = new DataSet();
  SqlDataAdapter da = new SqlDataAdapter();
  using (db)
  {
      db.Open();
      SqlTransaction trans = db.BeginTransaction();
      try
      {
          //insert into COMMSignalDefinition !!Problem HERE
          da.InsertCommand = 
              new SqlCommand("INSERT INTO COMMSignalDefinition(Name) " 
                             + "VALUES (@name)", db, trans);
  
          da.InsertCommand.Parameters.Add("@name", SqlDbType.NVarChar);
          foreach (DataRow row in ds.Tables["COMMTerminalSignal"].Select())
          {
              da.InsertCommand.Parameters[0].Value = row.ItemArray[1];
              da.InsertCommand.ExecuteNonQuery();
          }
  
          // insert into COMMSignalExceptionDefinition -- names
          da.InsertCommand = 
              new SqlCommand("INSERT INTO COMMSignalExceptionDefinition(Name) " 
                             + "VALUES (@name)", db, trans);
          da.InsertCommand.Parameters.Add("@name", SqlDbType.NVarChar);
          foreach (DataRow row in ds.Tables["COMMSignalExceptionDef"].Select())
          {
              da.InsertCommand.Parameters[0].Value = row.ItemArray[1];
              da.InsertCommand.ExecuteNonQuery();
          }
  
          trans.Commit();
          MessageBox.Show("You have successfully imported your Settings. " 
                          + "You can now exit the program.", 
                           "Success",
                           MessageBoxButtons.OK, 
                           MessageBoxIcon.Information);
      }
      catch (Exception e)
      {
          trans.Rollback();
          MessageBox.Show(e.Message,
                          "Error", 
                          MessageBoxButtons.OK, 
                          MessageBoxIcon.Error);
      }
  }
  </code></pre>
  
  <p>I have more inserts which work fine (I deleted the rest of them) and I moved the one with problems at the beginning.
   My question is what  could I possibly do wrong?
  I even verified if the "problematic" query is sent to the server, with <code>SQL Server Profiler,</code> and it does! And if I execute it in <code>SQL Server Management studio</code>, it works too.</p>
  
  <p><code>Connection Timeout</code> is set to 30</p>
  
  <p>Can You please give me some leads ?  SQL Server version is 2005 !
  Thank You!</p>