Using one single-application connection vs. one connection for every operation to SQL-Server via ADO

  • Thread starter Thread starter Sebastian
  • Start date Start date
S

Sebastian

Dear members,

I'am thinking about the "best" way to connect to my sql-server via
ADO.Net (if there is a best way).

My application uses the sql-server very intensively. At the moment
every database-operation opens a connection, executes and then closes
the connection.

Another way would be to use only a single connection to the database,
which is opened when the application starts.

What do you think is the better way to get a high performing sql
server: using one single application connection vs. using one
connection for every operation?

Cheers, Sebastian
 
since ADO.net already does the connection pooling for you, as long as you
are using the SQL connection object (and not the more generic oledb
connection object), you are best off doing what you are doing.

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
 
Acquire resources late and release early is the best policy, when it comes
to
Database connections. That way you can make sure that you are getting the
advantage
of in-built connection polling mechanism.
 
Back
Top