J
Joe Cool
I have been tasked to convert the methods in a data access class from
returning an open OdbcDataReader to a DataTable. I use the standard
type of code, like:
adapter = new OdbcDataAdapter();
adapter.SelectCommand = command;
dataSet = new DataSet();
adapter.Fill(dataSet, "Data");
adapter.Dispose();
dataTable = dataSet.Tables["Data"];
Where command is a command with an appropriate SQL SELECT statement.
This works fine UNLESS the connection that the command is associated
with is a connection that has an open Transaction. The adapter.Fill
method times out.
Since the row being read is the same row just inserted using the same
transaction, I tried adding IsolationLevel.ReadUncommitted to the
BeginTransaction method, but that did not help. Really didn't expect
it to since a OdbcDataReader read the row just fine with the default
isolation level.
Any help would be appreciated!!
returning an open OdbcDataReader to a DataTable. I use the standard
type of code, like:
adapter = new OdbcDataAdapter();
adapter.SelectCommand = command;
dataSet = new DataSet();
adapter.Fill(dataSet, "Data");
adapter.Dispose();
dataTable = dataSet.Tables["Data"];
Where command is a command with an appropriate SQL SELECT statement.
This works fine UNLESS the connection that the command is associated
with is a connection that has an open Transaction. The adapter.Fill
method times out.
Since the row being read is the same row just inserted using the same
transaction, I tried adding IsolationLevel.ReadUncommitted to the
BeginTransaction method, but that did not help. Really didn't expect
it to since a OdbcDataReader read the row just fine with the default
isolation level.
Any help would be appreciated!!