title: ORA-01000: maximum open cursors exceeded error
body: <p>I have the below code:</p>
  
  <pre><code> using (System.Data.OracleClient.OracleConnection dataConn = new System.Data.OracleClient.OracleConnection(_connectionString))
              {
                  using (System.Data.OracleClient.OracleCommand cmd = new System.Data.OracleClient.OracleCommand())
                  {
                      cmd.Connection = dataConn;
                      cmd.CommandText = "DELETE FROM Employees WHERE LOCATIONID=  :LOCATIONID";
                      cmd.Parameters.AddWithValue(":LOCATIONID", locationId);
                      dataConn.Open();
                      retVal += cmd.ExecuteNonQuery();
                      dataConn.Close();
                  }
                  using (System.Data.OracleClient.OracleCommand cmd = new System.Data.OracleClient.OracleCommand())
                  {
                      cmd.Connection = dataConn;
                      cmd.CommandText = string.Format("DELETE FROM Locations WHERE LocationId = :LOCATIONID";
                      cmd.Parameters.AddWithValue(":LOCATIONID", locationId);
                      dataConn.Open();
                      retVal += cmd.ExecuteNonQuery();
                      dataConn.Close();
                  }
              }
  </code></pre>
  
  <p>Just FYI, </p>
  
  <ul>
  <li>I am calling the above block in a loop of say 50 iterations.</li>
  <li>In each iteration, I am passing a new locationid.
  -The first query, for each iteration, is potentially deleting 500 records on    avg, as one location is assigned to 500 + employees.</li>
  </ul>
  
  <p>As per <a href="https://stackoverflow.com/questions/14150311/ora-01000-maximum-open-cursors-exceeded-in-asp-net">this</a> link:, I think I am doing things correctly, can anyone please point why I am still getting the <strong>ORA-01000: maximum open cursors exceeded</strong> error?
  Any help will be highly appreciated.
  Thanks.</p>