N
Norvin Laudon
Hi,
I'm getting an error inserting data into Oracle: "ExecuteNonQuery requires
an open and available Connection. The connection's current state is Open,
Executing."
The "NonQuery" I'm trying to execute a simple INSERT statement (which
executes fine in SQL+). The INSERT statement executes properly 99% of the
time, but throws this error sometimes.
Perhaps ExecuteNonQuery executes asynchronously? Am I possibly trying to
execute a command before the previous one is finished? Is there some way I
can make sure the previous command is finished?
<code>
if (cn.State != ConnectionState.Open)
{
cn = new OleDbConnection(connStr);
cn.Open();
}
OleDbCommand cmd = new OleDbCommand(q,cn);
cmd.ExecuteNonQuery();
cmd.Dispose();
<\code>
I'm getting an error inserting data into Oracle: "ExecuteNonQuery requires
an open and available Connection. The connection's current state is Open,
Executing."
The "NonQuery" I'm trying to execute a simple INSERT statement (which
executes fine in SQL+). The INSERT statement executes properly 99% of the
time, but throws this error sometimes.
Perhaps ExecuteNonQuery executes asynchronously? Am I possibly trying to
execute a command before the previous one is finished? Is there some way I
can make sure the previous command is finished?
<code>
if (cn.State != ConnectionState.Open)
{
cn = new OleDbConnection(connStr);
cn.Open();
}
OleDbCommand cmd = new OleDbCommand(q,cn);
cmd.ExecuteNonQuery();
cmd.Dispose();
<\code>