473,326 Members | 2,128 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,326 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

Aug 11 '05 #1
2 1486
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

Aug 11 '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

Aug 11 '05 #3

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

Similar topics

1
by: John Smith | last post by:
Ok, I have 2 xml files that are really similar. They have the exact same structure exept that in one XML some element are required and in the other they are simply absent from the xml. Problem...
4
by: Jeff | last post by:
We have multiple ASP.Net web apps in development. As a standard we are looking to go with SQL Server to hold state information. Can we have the multiple apps all point to a single State DB? Or...
2
by: Andy Fish | last post by:
Hi, I have a single-file aspx file (no codebehind). when I try to do this: <%@ Import Namespace="MySql.Data.MySqlClient" %> I get this: CS0246: The type or namespace name 'MySql' could...
1
by: arthy | last post by:
Hi, Is it possible to execute multiple statements on to the database using a single dbconnection object.what is the drawback in using .If not possible ,then how can the execution of multiple...
0
by: Luqman | last post by:
I have used a single objectDataSource for GridView and DetailView, and when I load the page, the GridView shows all the entries of Invoice, and DetailView shows the 1st entry of Invoice, thats all...
3
by: tushar jadhav | last post by:
Suppose, i hv an 10 columns and next to that other columns in a DB Table. That 10 columns hv same default values & others are retriving from other table and are nearly 1000 records. How can i insert...
0
by: satishLikesCoding | last post by:
Hi, Currently I have 3 stylesheet classes, each rendering an image as background. I have 3 images as.. Left half rounded Middle covered area Right half round When I attach 1 of the...
1
by: mrbadboy | last post by:
Hi, I need to submit multiple forms with using single button. I've mentioned my code below. <? if(isset($_POST)){ print_r($_POST); } ?> <script type="text/javascript">
1
by: raul15791 | last post by:
Hi, I'm newbie in ASP. I am trying to view multiple pages by using a single file. For example, I have a few pages of product.asp (products.asp, products1.asp and so on). Now I want to create a...
3
by: marsh44 | last post by:
I am using a multiple filters to search for specific criteria. In one of the filters criteria, I need to use the OR instead of the AND as illustrated below. When insterting the OR it will not...
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...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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...

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.