Datareader and Connection

  • Thread starter Thread starter Vishesh Vyas
  • Start date Start date
V

Vishesh Vyas

Hi,

Can we check how many datareaders are associated with the connection? If
yes, then how?

Thanks & Regards,
Vishesh Vyas
 
I think you can't retrieve informations about datareaders from the
oledbConnection object. I imagine that is the same with sqlconnection
and oracleConnection objects.
In fact the datareader object is not directly associated with the
connection object.It is via its command object which as a connection
property.

Could you tell more about what you want to do?

hope this helps

http://oraclevsmicrosoft.blogspot.com
 
Hi Vishesh,

The only thing you can do is to iterate through all readers and compare
their Connection property.
However, only one reader can be active at the same time on a connection
instance.
 
Thanks for your reply..

By which way we can iterate through the Live Datareaders.

Reagrds,
Vishesh Vyas

Miha Markic said:
Hi Vishesh,

The only thing you can do is to iterate through all readers and compare
their Connection property.
However, only one reader can be active at the same time on a connection
instance.

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
www.rthand.com
SLODUG - Slovene Developer Users Group www.codezone-si.info

Vishesh Vyas said:
Hi,

Can we check how many datareaders are associated with the connection? If
yes, then how?

Thanks & Regards,
Vishesh Vyas
 
Hi,

You have to store references to them somewhere - perhaps in a collection.
Otherwise you don't know how to reach them...

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
www.rthand.com
SLODUG - Slovene Developer Users Group www.codezone-si.info

Vishesh Vyas said:
Thanks for your reply..

By which way we can iterate through the Live Datareaders.

Reagrds,
Vishesh Vyas

Miha Markic said:
Hi Vishesh,

The only thing you can do is to iterate through all readers and compare
their Connection property.
However, only one reader can be active at the same time on a connection
instance.

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
www.rthand.com
SLODUG - Slovene Developer Users Group www.codezone-si.info

Vishesh Vyas said:
Hi,

Can we check how many datareaders are associated with the connection?
If
yes, then how?

Thanks & Regards,
Vishesh Vyas
 
Back
Top