Re: Best practice to work with multiple DB connections
- From: "Venkat" <stammana@xxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 1 Oct 2007 12:37:56 +0100
Thanks for your valuable input. Can you suggest the best one out of your two suggestions?
"Marc Gravell" <marc.gravell@xxxxxxxxx> wrote in message news:uVhAV4BBIHA.1212@xxxxxxxxxxxxxxxxxxxxxxx
0) Since you are on SQL2005, try enabling MARS; this will allow you to call ExecuteScalar -on the same connection - while ExecuteReader is in progress. Sounds too good to be true, but worth a try. Just tweak the connection string to include ";MultipleActiveResultSets=True"
1/2) is not as big an issue as you think, since .NET provides pooling by default. When you Close() a managed connection it (by default) simply goes back into the pool. There is a very good chance (in such an app) that you will get the same actual connection (albeit reset) next time.
Marc
.
- Follow-Ups:
- Re: Best practice to work with multiple DB connections
- From: Marc Gravell
- Re: Best practice to work with multiple DB connections
- References:
- Best practice to work with multiple DB connections
- From: Venkat
- Re: Best practice to work with multiple DB connections
- From: Marc Gravell
- Best practice to work with multiple DB connections
- Prev by Date: RE: Rights for SNMP service
- Next by Date: Re: The type 'frm_data.frm_data' is defined in an assembly that is not referenced. You must add a reference to assembly
- Previous by thread: Re: Best practice to work with multiple DB connections
- Next by thread: Re: Best practice to work with multiple DB connections
- Index(es):
Relevant Pages
|