Click here to Skip to main content
15,891,633 members
Home / Discussions / C#
   

C#

 
AnswerRe: dispose (always?) Pin
Ed Hill _5_5-Aug-12 22:12
Ed Hill _5_5-Aug-12 22:12 
AnswerRe: dispose (always?) Pin
OriginalGriff5-Aug-12 22:18
mveOriginalGriff5-Aug-12 22:18 
AnswerRe: dispose (always?) Pin
BobJanova5-Aug-12 23:49
BobJanova5-Aug-12 23:49 
GeneralRe: dispose (always?) Pin
PIEBALDconsult6-Aug-12 3:50
mvePIEBALDconsult6-Aug-12 3:50 
GeneralRe: dispose (always?) Pin
BobJanova7-Aug-12 0:26
BobJanova7-Aug-12 0:26 
GeneralRe: dispose (always?) Pin
PIEBALDconsult7-Aug-12 3:36
mvePIEBALDconsult7-Aug-12 3:36 
GeneralRe: dispose (always?) Pin
thewazz7-Aug-12 4:58
professionalthewazz7-Aug-12 4:58 
GeneralRe: dispose (always?) Pin
Pete O'Hanlon7-Aug-12 23:43
mvePete O'Hanlon7-Aug-12 23:43 
For a moment, let's assume that we are talking about a SqlConnection here. When you call Dispose on the connection, all it does is call Close and then calls Dispose on the object it derives from (which just fires off the EventDisposed event to any listeners, and removes the instance from any Site Container instance. So, what does all this have to do with the price of fromage?

Well, the only part that is of any real interest there is the Close, so given that this is all that the Dispose is really doing, you are fine keeping the connection available for use, and just use Close on it until you really are ready to get rid of it.

*pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

"Mind bleach! Send me mind bleach!" - Nagy Vilmos


CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier

GeneralRe: dispose (always?) Pin
jschell10-Aug-12 12:42
jschell10-Aug-12 12:42 
GeneralRe: dispose (always?) Pin
PIEBALDconsult10-Aug-12 13:38
mvePIEBALDconsult10-Aug-12 13:38 
GeneralRe: dispose (always?) Pin
jschell11-Aug-12 7:28
jschell11-Aug-12 7:28 
GeneralRe: dispose (always?) Pin
PIEBALDconsult11-Aug-12 12:05
mvePIEBALDconsult11-Aug-12 12:05 
QuestionC# setup and deployment projects Pin
Zeyad Jalil4-Aug-12 3:26
professionalZeyad Jalil4-Aug-12 3:26 
AnswerRe: C# setup and deployment projects Pin
jschell4-Aug-12 7:00
jschell4-Aug-12 7:00 
QuestionRe: C# setup and deployment projects Pin
Zeyad Jalil4-Aug-12 20:12
professionalZeyad Jalil4-Aug-12 20:12 
AnswerRe: C# setup and deployment projects Pin
jschell5-Aug-12 7:26
jschell5-Aug-12 7:26 
AnswerRe: C# setup and deployment projects Pin
Paul Conrad4-Aug-12 11:47
professionalPaul Conrad4-Aug-12 11:47 
AnswerRe: C# setup and deployment projects Pin
Bernhard Hiller5-Aug-12 22:26
Bernhard Hiller5-Aug-12 22:26 
GeneralRe: C# setup and deployment projects Pin
Zeyad Jalil7-Aug-12 20:52
professionalZeyad Jalil7-Aug-12 20:52 
AnswerRe: C# setup and deployment projects Pin
Vijay Selvaraj26-Aug-12 22:12
Vijay Selvaraj26-Aug-12 22:12 
QuestionC# window form Pin
yashdiljale4-Aug-12 1:19
yashdiljale4-Aug-12 1:19 
AnswerRe: C# window form Pin
Pete O'Hanlon4-Aug-12 2:41
mvePete O'Hanlon4-Aug-12 2:41 
AnswerRe: C# window form Pin
OriginalGriff4-Aug-12 3:45
mveOriginalGriff4-Aug-12 3:45 
AnswerRe: C# window form Pin
BillWoodruff4-Aug-12 4:40
professionalBillWoodruff4-Aug-12 4:40 
AnswerRe: C# window form Pin
Christian Amado6-Aug-12 10:29
professionalChristian Amado6-Aug-12 10:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.