Click here to Skip to main content
15,894,405 members
Home / Discussions / C#
   

C#

 
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 
GeneralRe: dispose (always?) Pin
jschell10-Aug-12 12:42
jschell10-Aug-12 12:42 
PIEBALDconsult wrote:
So you can hold onto a Connection for a long time and only open it when you need it.


True but in normal practice that shouldn't happen.

First the significance in the object is the connection. If there is no connection then the object itself is light weight so creation itself isn't doing anything (again for most situations.)

Second if you keep it around you must explicitly manage the state. So to reuse it you would need to either explicitly check the state or implicitly assume the state is correct. The first case requires additional code and the second leads to complexity as the maintenance engineer would need to insure correct state. Both of those cases are more easily solved by using creation.
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 
AnswerRe: C# window form Pin
Vijay Selvaraj26-Aug-12 22:14
Vijay Selvaraj26-Aug-12 22:14 

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.