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

C#

 
AnswerRe: class vs interface Pin
davidnz26-Mar-11 22:46
davidnz26-Mar-11 22:46 
AnswerRe: class vs interface Pin
Pravin Patil, Mumbai28-Mar-11 1:56
Pravin Patil, Mumbai28-Mar-11 1:56 
Questionattributes Pin
Abou taleb26-Mar-11 1:33
Abou taleb26-Mar-11 1:33 
AnswerRe: attributes Pin
Not Active26-Mar-11 3:03
mentorNot Active26-Mar-11 3:03 
GeneralRe: attributes Pin
Abou taleb28-Mar-11 0:29
Abou taleb28-Mar-11 0:29 
AnswerRe: attributes Pin
Dave Kreskowiak26-Mar-11 6:22
mveDave Kreskowiak26-Mar-11 6:22 
QuestionOpen Close Connection Every-time Pin
Anubhava Dimri25-Mar-11 22:40
Anubhava Dimri25-Mar-11 22:40 
AnswerRe: Open Close Connection Every-time Pin
Keith Barrow25-Mar-11 23:18
professionalKeith Barrow25-Mar-11 23:18 
Normally you'd do the first (though you might execute several related SQL statments in one block), and keep the connection open for the shortest time possible.
The SQL server has a finite amount of connections, keeping one open blocks it "permanently".

If you are worried about perfomance, you can probably cache some data on the SQL client. Another thing to do is to set the pooling attribute to true, which reduces the overhead induced when creating connection objects. You must close the connection to return them to the pool. See http://msdn.microsoft.com/en-us/library/8xx3tyca(v=vs.71).aspx[^] for some details.
[edit]
This[^] explains how and why it works a little better.

AnswerRe: Open Close Connection Every-time Pin
OriginalGriff25-Mar-11 23:53
mveOriginalGriff25-Mar-11 23:53 
GeneralRe: Open Close Connection Every-time Pin
Anubhava Dimri26-Mar-11 0:02
Anubhava Dimri26-Mar-11 0:02 
GeneralRe: Open Close Connection Every-time PinPopular
OriginalGriff26-Mar-11 0:11
mveOriginalGriff26-Mar-11 0:11 
GeneralRe: Open Close Connection Every-time Pin
Anubhava Dimri26-Mar-11 0:14
Anubhava Dimri26-Mar-11 0:14 
GeneralRe: Open Close Connection Every-time Pin
OriginalGriff26-Mar-11 0:16
mveOriginalGriff26-Mar-11 0:16 
AnswerRe: Open Close Connection Every-time Pin
PIEBALDconsult26-Mar-11 3:47
mvePIEBALDconsult26-Mar-11 3:47 
QuestionIssue with App Settings (Settings.setting & user.config) and version info Pin
SledgeHammer0125-Mar-11 14:08
SledgeHammer0125-Mar-11 14:08 
AnswerRe: Issue with App Settings (Settings.setting & user.config) and version info Pin
SledgeHammer0125-Mar-11 14:20
SledgeHammer0125-Mar-11 14:20 
GeneralRe: Issue with App Settings (Settings.setting & user.config) and version info Pin
GenJerDan26-Mar-11 14:08
GenJerDan26-Mar-11 14:08 
QuestionGmail inbox retrive Pin
Md. Shamiul Islam Hiron25-Mar-11 12:52
Md. Shamiul Islam Hiron25-Mar-11 12:52 
AnswerRe: Gmail inbox retrive Pin
shivamkalra25-Mar-11 13:38
shivamkalra25-Mar-11 13:38 
GeneralRe: Gmail inbox retrive Pin
Keith Barrow25-Mar-11 13:47
professionalKeith Barrow25-Mar-11 13:47 
AnswerRe: Gmail inbox retrive Pin
Keith Barrow25-Mar-11 13:45
professionalKeith Barrow25-Mar-11 13:45 
GeneralRe: Gmail inbox retrive Pin
shivamkalra26-Mar-11 7:42
shivamkalra26-Mar-11 7:42 
AnswerRe: Gmail inbox retrive Pin
Ganesh Kumar Kaki13-Apr-11 2:51
Ganesh Kumar Kaki13-Apr-11 2:51 
Questionget HTML elements with C# in ASP.NET Pin
msqar25-Mar-11 9:51
msqar25-Mar-11 9:51 
AnswerWrong Forum Pin
Keith Barrow25-Mar-11 13:51
professionalKeith Barrow25-Mar-11 13:51 

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.