Click here to Skip to main content


AnswerRe: dispose (always?) PinmvpOriginalGriff5-Aug-12 23:18 
AnswerRe: dispose (always?) PinmemberBobJanova6-Aug-12 0:49 
GeneralRe: dispose (always?) PinmemberPIEBALDconsult6-Aug-12 4:50 
GeneralRe: dispose (always?) PinmemberBobJanova7-Aug-12 1:26 
GeneralRe: dispose (always?) PinmemberPIEBALDconsult7-Aug-12 4:36 
GeneralRe: dispose (always?) Pinmemberthewazz7-Aug-12 5:58 
GeneralRe: dispose (always?) PinprotectorPete O'Hanlon8-Aug-12 0:43 
GeneralRe: dispose (always?) Pinmemberjschell10-Aug-12 13: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?) PinmemberPIEBALDconsult10-Aug-12 14:38 
GeneralRe: dispose (always?) Pinmemberjschell11-Aug-12 8:28 
GeneralRe: dispose (always?) PinmemberPIEBALDconsult11-Aug-12 13:05 
QuestionC# setup and deployment projects Pinmemberzead4-Aug-12 4:26 
AnswerRe: C# setup and deployment projects Pinmemberjschell4-Aug-12 8:00 
QuestionRe: C# setup and deployment projects Pinmemberzead4-Aug-12 21:12 
AnswerRe: C# setup and deployment projects Pinmemberjschell5-Aug-12 8:26 
AnswerRe: C# setup and deployment projects PinmemberPaul Conrad4-Aug-12 12:47 
AnswerRe: C# setup and deployment projects PinmemberBernhard Hiller5-Aug-12 23:26 
GeneralRe: C# setup and deployment projects Pinmemberzead7-Aug-12 21:52 
AnswerRe: C# setup and deployment projects PinmemberMember 451899226-Aug-12 23:12 
QuestionC# window form Pinmemberyashdiljale4-Aug-12 2:19 
AnswerRe: C# window form PinprotectorPete O'Hanlon4-Aug-12 3:41 
AnswerRe: C# window form PinmvpOriginalGriff4-Aug-12 4:45 
AnswerRe: C# window form PinmemberBillWoodruff4-Aug-12 5:40 
AnswerRe: C# window form PinmemberChristian Amado6-Aug-12 11:29 
AnswerRe: C# window form PinmemberMember 451899226-Aug-12 23:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    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.150129.1 | Last Updated 31 Jan 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid