ba272
asked on
The OleDbCommand is currently busy Open, Fetching
Hi,
When I perform a query, followed by another query, the OleDbCommand is still busy. How should I re-initialize this?
Thanks,
Bob
sql = "SELECT * FROM DeliveryRunDetail WHERE ProcessName='Test';
dbCommand1.CommandText = sql;
dbCommand1.ExecuteNonQuery ();
reader = dbCommand1.ExecuteReader() ;
while ( reader.Read() )
{
// do something
}
sql = "DELETE * FROM DeliveryRunDetail WHERE ProcessName='Test2'";
dbCommand1.CommandText = sql;
dbCommand1.ExecuteNonQuery ();
When I perform a query, followed by another query, the OleDbCommand is still busy. How should I re-initialize this?
Thanks,
Bob
sql = "SELECT * FROM DeliveryRunDetail WHERE ProcessName='Test';
dbCommand1.CommandText = sql;
dbCommand1.ExecuteNonQuery
reader = dbCommand1.ExecuteReader()
while ( reader.Read() )
{
// do something
}
sql = "DELETE * FROM DeliveryRunDetail WHERE ProcessName='Test2'";
dbCommand1.CommandText = sql;
dbCommand1.ExecuteNonQuery
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Creating a new command instance would be better.
Bob
Bob
ASKER
Hey Bob,
could you give an example so we're on the same page?
Bob
could you give an example so we're on the same page?
Bob
Bob,
Do you want to stick with the OleDbDataReader?
Bob
Do you want to stick with the OleDbDataReader?
Bob
ASKER
for now. I've got quite a large program created.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
ok
Cheers
Mohan