I would run sp_lock to see if a lock contention is blocking the
operation--of course this assumes you're using SQL Server, but now that I
see you're using ODBC, it probably isn't and you're basically on your own
AFA diagnostic tools.
I would also tend to lean toward simpler code: (pseudo code follows)
Dim tb as New DataTable
Dim dr as xxDataReader
dim cmd as new xxCommand(MySelectStatement, myConnection)
cn.open
dr=cmd.ExecuteReader
tb.load (dr)
cn.close
hth
--
__________________________________________________________________________
William R. Vaughn
President and Founder Beta V Corporation
Author, Mentor, Dad, Grandpa
Microsoft MVP
(425) 556-9205 (Pacific time)
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
http://betav.com http://betav.com/blog/billva
____________________________________________________________________________________________
"Joe Cool" <(E-Mail Removed)> wrote in message
news:5e686a36-e0b7-47a3-9f54-(E-Mail Removed)...
> 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!!