Help .....System.InvalidOperationException: The SqlCommand is currently busy Open, Fetching.

  • Thread starter Thread starter Giox
  • Start date Start date
G

Giox

Hello everybody
my program generate the following exception
"System.InvalidOperationException: The SqlCommand is currently busy
Open, Fetching."
when I delete a list of record from a database.
I have a listbox and with a foreach I loop inside the records of the
listbox and I delete the elements from the database.
When I execute the program I open the connection and I close it at the
end. I create the connection each time I call the method

Any idea?
 
Hi,

I would assume you have transaction problem - are you sure that you close
transaction and connection properly?
Is anybody else touching same records?
 
Have you left a DataReader open on the connection? You can only have one
active query on a connetion in V1.x, though V2.0 allows more than one when
working against SQL Server 2005...
 
No, I use no datareader, I use dataadapter, sql command and datasets :-(

Alex Homer said:
Have you left a DataReader open on the connection? You can only have one
active query on a connetion in V1.x, though V2.0 allows more than one when
working against SQL Server 2005...
 
Back
Top