Click here to Skip to main content
12,999,837 members (54,099 online)
   

C#

 
AnswerRe: dispose (always?) Pin
OriginalGriff5-Aug-12 22:18
mvpOriginalGriff5-Aug-12 22:18 
AnswerRe: dispose (always?) Pin
BobJanova5-Aug-12 23:49
memberBobJanova5-Aug-12 23:49 
GeneralRe: dispose (always?) Pin
PIEBALDconsult6-Aug-12 3:50
memberPIEBALDconsult6-Aug-12 3:50 
GeneralRe: dispose (always?) Pin
BobJanova7-Aug-12 0:26
memberBobJanova7-Aug-12 0:26 
GeneralRe: dispose (always?) Pin
PIEBALDconsult7-Aug-12 3:36
memberPIEBALDconsult7-Aug-12 3:36 
GeneralRe: dispose (always?) Pin
thewazz7-Aug-12 4:58
memberthewazz7-Aug-12 4:58 
GeneralRe: dispose (always?) Pin
Pete O'Hanlon7-Aug-12 23:43
protectorPete O'Hanlon7-Aug-12 23:43 
GeneralRe: dispose (always?) Pin
jschell10-Aug-12 12:42
memberjschell10-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
memberPIEBALDconsult10-Aug-12 13:38 
GeneralRe: dispose (always?) Pin
jschell11-Aug-12 7:28
memberjschell11-Aug-12 7:28 
GeneralRe: dispose (always?) Pin
PIEBALDconsult11-Aug-12 12:05
memberPIEBALDconsult11-Aug-12 12:05 
QuestionC# setup and deployment projects Pin
zead4-Aug-12 3:26
memberzead4-Aug-12 3:26 
AnswerRe: C# setup and deployment projects Pin
jschell4-Aug-12 7:00
memberjschell4-Aug-12 7:00 
QuestionRe: C# setup and deployment projects Pin
zead4-Aug-12 20:12
memberzead4-Aug-12 20:12 
AnswerRe: C# setup and deployment projects Pin
jschell5-Aug-12 7:26
memberjschell5-Aug-12 7:26 
AnswerRe: C# setup and deployment projects Pin
Paul Conrad4-Aug-12 11:47
memberPaul Conrad4-Aug-12 11:47 
AnswerRe: C# setup and deployment projects Pin
Bernhard Hiller5-Aug-12 22:26
memberBernhard Hiller5-Aug-12 22:26 
GeneralRe: C# setup and deployment projects Pin
zead7-Aug-12 20:52
memberzead7-Aug-12 20:52 
AnswerRe: C# setup and deployment projects Pin
Member 451899226-Aug-12 22:12
memberMember 451899226-Aug-12 22:12 
QuestionC# window form Pin
yashdiljale4-Aug-12 1:19
memberyashdiljale4-Aug-12 1:19 
AnswerRe: C# window form Pin
Pete O'Hanlon4-Aug-12 2:41
protectorPete O'Hanlon4-Aug-12 2:41 
AnswerRe: C# window form Pin
OriginalGriff4-Aug-12 3:45
mvpOriginalGriff4-Aug-12 3:45 
AnswerRe: C# window form Pin
BillWoodruff4-Aug-12 4:40
memberBillWoodruff4-Aug-12 4:40 
AnswerRe: C# window form Pin
Christian Amado6-Aug-12 10:29
memberChristian Amado6-Aug-12 10:29 
AnswerRe: C# window form Pin
Member 451899226-Aug-12 22:14
memberMember 451899226-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.


Advertise | Privacy | Mobile
Web02 | 2.8.170624.1 | Last Updated 24 Jun 2017
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid