473,323 Members | 1,537 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,323 software developers and data experts.

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

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

Nov 21 '05 #1
2 841
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.
--
"Sebastian" <ha******@yahoo.de> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
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

Nov 21 '05 #2
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.

--
Roji. P. Thomas
Net Asset Management
http://toponewithties.blogspot.com
"Sebastian" <ha******@yahoo.de> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
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

Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: C. Alexander | last post by:
I'm making a 'whiteboard' application. I'm trying to have 2+ connected users able to draw at the same time. However, if User1 draws a line, when User2 is drawing, on User1 screen, it will draw...
8
by: ComputerSmith | last post by:
Hi all. I have programmed VB6 apps before, ones that use dropdown listboxes, text boxes, etc... normal stuff. I was asked by a friend to write a "simple" app that I am unsure how to proceed...
5
by: Ben Jessel | last post by:
I am in the process of converting my site to using XHTML and CSS. A lot of my sites include tables of data, which are highlighted using javascript rollovers. I have converted my a lot of my...
2
by: asd987 | last post by:
Hi, I use document.write in a HTML-document to display same information. Now I have a problem displaying text that sometimes contains two kinds of quotes simultanelisly. I don't know on...
16
by: Wayne Aprato | last post by:
I have several Access 97 databases which are split into front end and back end running off a server. The front end mde is shared by 2 or 3 - absolute maximum of 6 concurrent users. This scenario...
5
by: John Dumais | last post by:
Hello, I have been trying to figure out how to write an array of doubles (in this specific case) to a binary stream without using a loop. What I have been doing is... foreach(double d in...
6
by: Y2K | last post by:
I'm hoping someone can lend a hand. I've now been turned down four times on Rentacoder because of various reasons... too difficult, wants more $, needs complete rewrite, and coder never got bit...
5
by: Johannes Röckert | last post by:
Hi, can anyone help me on how to develop a program in c++ which does single step execution using a callback between the asm commands? I need something like debuggers do - a callback function...
6
by: Nirjhar Oberoi | last post by:
Hi, Can you add two numbers using a Single Variable? :-) If yes then show me the code!!! Regards Nirjhar
29
by: garyusenet | last post by:
I'm trying to investigate the maximum size of different variable types. I'm using INT as my starting variable for exploration. I know that the maximum number that the int variable can take is:...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.