Database connections in Web Services

R

Random

What is the best way to handle database connections within a Web Service?
I'd like to pool connections for optimum efficiency.
 
R

RP

So long as you use the same connection parameters i.e. login etc. ado.net
connection pooling should handle that for you.
 
R

Random

But how should I handle the instantiation of the SQLConnection object? In a
private variable seems right, but should I declare it using the New operator
there... or do that within my WebMethods?
 
J

John Timney \(Microsoft MVP\)

Webservices by design should be stateless for maximum efficeincy. Open it
in your webmethod, use it and close it all within the method. Let the
connection pooling look after itself unless you are receiving problems..

--
Regards

John Timney
Microsoft Regional Director
Microsoft MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top