Re: Question about Dispose
From: Bob Lehmann (none)
Date: 05/20/04
- Next message: hb: "Re: Capturing Enter KeyDown in a TextBox"
- Previous message: Jon Skeet [C# MVP]: "Re: Question about Dispose"
- In reply to: Mythran: "Re: Question about Dispose"
- Next in thread: Angel Saenz-Badillos[MS]: "Re: Question about Dispose"
- Reply: Angel Saenz-Badillos[MS]: "Re: Question about Dispose"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 20 May 2004 10:39:08 -0600
OK - got it.
Thanks,
Bob Lehmann
"Mythran" <kip_potter@hotmail.com> wrote in message
news:#2SbaXoPEHA.4036@TK2MSFTNGP12.phx.gbl...
>
> "Bob Lehmann" <none> wrote in message
> news:uxIpzSoPEHA.3348@TK2MSFTNGP09.phx.gbl...
> > Thanks, Jon.
> >
> > So, is there any reason to *ever* use Close() instead?
> >
> > Bob Lehmann
>
> Yes, quoted from Ashish:
>
> "The Dispose() method releases all resources associated to the connection
> object (including removing it from the connection pool). Not a good
practise
> to call Dispose() unless you want connection to be removed from the
> connection pool."
>
>
> That about sums it up :)
>
> If you are worried about connection pooling, you will want to not use
> Try...Finally and Dispose(). You will use Try...Finally and then check to
see if
> 1.) the connection exists 2.) it's open 3.) call Close().
>
> Hope this helps :)
>
> Mythran
>
>
- Next message: hb: "Re: Capturing Enter KeyDown in a TextBox"
- Previous message: Jon Skeet [C# MVP]: "Re: Question about Dispose"
- In reply to: Mythran: "Re: Question about Dispose"
- Next in thread: Angel Saenz-Badillos[MS]: "Re: Question about Dispose"
- Reply: Angel Saenz-Badillos[MS]: "Re: Question about Dispose"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|