Click here to Skip to main content
15,895,557 members
Home / Discussions / C#
   

C#

 
GeneralRe: storing images to folder in c# Pin
Pete O'Hanlon10-Feb-13 10:07
mvePete O'Hanlon10-Feb-13 10:07 
QuestionHow to create a C# Application which can automatically install an Application or server ? Pin
Rahul Sarkar10-Feb-13 6:43
Rahul Sarkar10-Feb-13 6:43 
AnswerRe: How to create a C# Application which can automatically install an Application or server ? Pin
Rahul Sarkar10-Feb-13 6:58
Rahul Sarkar10-Feb-13 6:58 
AnswerRe: How to create a C# Application which can automatically install an Application or server ? Pin
Jegan Thiyagesan13-Feb-13 2:52
Jegan Thiyagesan13-Feb-13 2:52 
QuestionC# connection pooling Pin
classy_dog9-Feb-13 21:52
classy_dog9-Feb-13 21:52 
AnswerRe: C# connection pooling Pin
N a v a n e e t h10-Feb-13 3:19
N a v a n e e t h10-Feb-13 3:19 
GeneralRe: C# connection pooling Pin
PIEBALDconsult10-Feb-13 4:51
mvePIEBALDconsult10-Feb-13 4:51 
GeneralRe: C# connection pooling Pin
jschell10-Feb-13 8:10
jschell10-Feb-13 8:10 
PIEBALDconsult wrote:
My understanding is that the connection is returned to the pool when you close it; you don't need to dispose it immediately.


From the documentation for SqlConnection.close()

"Close and Dispose are functionally equivalent."

PIEBALDconsult wrote:
I keep a connection for the life of am application (some of which are Services that run 24/7 for months on end) and open/close as needed.


Not sure what that means. But
1. You should close it or dispose it when you are done with it in the functional block. There is no point in holding on to the instance.
2. The fact that a service is 24x7 doesn't mean that the database won't need to be rebooted. And if you are actually holding on to the connection then the result will be an exception. At least with the pool (connection close/disposed immediately) you have the chance of recovering eventually. The pool doesn't recover connections in use and it only drops connections when a usage attempt results in an error that is the result of a failed connection.

PIEBALDconsult wrote:
Instantiating the same connections millions of times a day is not a good idea.


Object instantiation is a trivial cost in modern OO languages. So that can't be what you are referring to.

Connection creation in a modern data center is rather insignificant. However that doesn't matter because unless you explicitly set up the connection pool to do otherwise the pool will be holding active connections. So opening a connection does nothing but retrieve it from the pool. So "instantiating" means nothing in this context.
GeneralRe: C# connection pooling Pin
PIEBALDconsult10-Feb-13 17:02
mvePIEBALDconsult10-Feb-13 17:02 
AnswerRe: C# connection pooling Pin
jschell10-Feb-13 8:28
jschell10-Feb-13 8:28 
QuestionProtocol Handler C# Pin
thomas mason9-Feb-13 15:44
thomas mason9-Feb-13 15:44 
AnswerRe: Protocol Handler C# Pin
Jibesh9-Feb-13 18:59
professionalJibesh9-Feb-13 18:59 
AnswerRe: Protocol Handler C# Pin
N a v a n e e t h10-Feb-13 2:44
N a v a n e e t h10-Feb-13 2:44 
AnswerRe: Protocol Handler C# Pin
Eddy Vluggen10-Feb-13 6:08
professionalEddy Vluggen10-Feb-13 6:08 
GeneralRe: Protocol Handler C# Pin
thomas mason10-Feb-13 16:11
thomas mason10-Feb-13 16:11 
AnswerRe: Protocol Handler C# Pin
classy_dog10-Feb-13 16:51
classy_dog10-Feb-13 16:51 
AnswerRe: Protocol Handler C# Pin
José Amílcar Casimiro11-Feb-13 3:17
José Amílcar Casimiro11-Feb-13 3:17 
QuestionTableAdapter.Update() doen't work Pin
fheyn9-Feb-13 11:06
fheyn9-Feb-13 11:06 
AnswerRe: TableAdapter.Update() doen't work Pin
OriginalGriff9-Feb-13 11:53
mveOriginalGriff9-Feb-13 11:53 
AnswerRe: TableAdapter.Update() doen't work Pin
Muthuraja Irullandi10-Feb-13 0:09
Muthuraja Irullandi10-Feb-13 0:09 
Questionmultiplication Pin
abhishek9111199-Feb-13 7:35
abhishek9111199-Feb-13 7:35 
AnswerRe: multiplication Pin
Eddy Vluggen9-Feb-13 8:23
professionalEddy Vluggen9-Feb-13 8:23 
GeneralRe: multiplication Pin
PIEBALDconsult9-Feb-13 10:27
mvePIEBALDconsult9-Feb-13 10:27 
GeneralRe: multiplication Pin
abhishek9111199-Feb-13 16:55
abhishek9111199-Feb-13 16:55 
GeneralRe: multiplication Pin
Jibesh9-Feb-13 19:07
professionalJibesh9-Feb-13 19:07 

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.