N
nevin
Hi all,
I have a transaction open, run a query which inserts data under the
trabsaction and returns a row of data into a SqlDataReader which I put into
some variables, all no problem.
I then close the DataReader making sure it's just dr.Close() rather than
dr.Close(CommandBehavior.CloseConnection) to avoid the connection closing.
Now I create a SqlCommand using the still open transaction to just insert a
record into another table using ExecuteNonQuery()
Finally I commit the transaction.
The data inserted using the ExecuteNonQuery() is ok but the one using the
ExecuteDataReader() isn't.
Surely I should be able to mix a reader and straight data inserts this way?
Anyone have any ideas?
Thanks
Nevin.
I have a transaction open, run a query which inserts data under the
trabsaction and returns a row of data into a SqlDataReader which I put into
some variables, all no problem.
I then close the DataReader making sure it's just dr.Close() rather than
dr.Close(CommandBehavior.CloseConnection) to avoid the connection closing.
Now I create a SqlCommand using the still open transaction to just insert a
record into another table using ExecuteNonQuery()
Finally I commit the transaction.
The data inserted using the ExecuteNonQuery() is ok but the one using the
ExecuteDataReader() isn't.
Surely I should be able to mix a reader and straight data inserts this way?
Anyone have any ideas?
Thanks
Nevin.