Re: Call SqlCommand.ExecuteReader inside another SqlCommand.ExecuteRea

Tech-Archive recommends: Fix windows errors by optimizing your registry



Any SqlConnection object can only have one active SqlDataReader at a time.

To do what you need to do you need to have a second SqlConnection object for
the inner SqlDataReader.

I do not think that a 'transaction' can span multiple connections.

It appears that you are only 'reading' so there does not appear to be any
need for a transaction.


"David Thielen" <thielen@xxxxxxxxxxxxx> wrote in message
news:B99A7816-4975-476B-B0D6-52C32359CA13@xxxxxxxxxxxxxxxx
ps - with all of this within the same transaction.

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm




"David Thielen" wrote:

Hi;

I need to call SqlCommand.ExecuteReader and then inside a while
(reader.Read()) I need to call another SqlCommand.ExecuteReader. I need
to do
this because I have a FK:PK relationship and based on the FK read, then
read
the row in that related table - if the FK is not null.

How can I do this?

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm




.



Relevant Pages

  • Re: Transactions under ADO.NET 1.1
    ... DataAdpater.SelectCommand, UpdateCommand or DeleteCommand's Transaction ... calling BeginTransaction on the SqlConnection object? ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Transaction Management - BL to DAL
    ... I am using the same concept which u have explained for Transaction, in BLL, but i am getting a exception "The Transaction has Aborted" on the execution reach my con.openstatement. ... con is the SqlConnection Object. ...
    (microsoft.public.dotnet.framework.adonet)