Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 355109
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T11:59:14+00:00 2026-05-12T11:59:14+00:00

For example, I need to fill lots of DataTables with SQLDataAdapter’s Fill() method: DataAdapter1.Fill(DataTable1);

  • 0

For example, I need to fill lots of DataTables with SQLDataAdapter’s Fill() method:

DataAdapter1.Fill(DataTable1);
DataAdapter2.Fill(DataTable2);
DataAdapter3.Fill(DataTable3);
DataAdapter4.Fill(DataTable4);
DataAdapter5.Fill(DataTable5);
....
....

Even all the dataadapter objects use the same SQLConnection, each Fill method will open and close the connection unless the connection state is already open before the method call.

What I want to know is how does unnecessarily opening and closing SQLConnections affect the performance of the application. How much does it need to scale to see the bad effects of this problem (100,000s of concurrent users?). In a mid-size website (daily 50000 users) does it worth bothering and searching for all the Fill() calls, keeping them together in the code and opening the connection before any Fill() call and closing afterwards?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T11:59:14+00:00Added an answer on May 12, 2026 at 11:59 am

    ADO.NET has connection pooling, e.g. when you close a connection, it’s not really completely closed, but “recycled” if you ask for a new connection with exactly the same connection string.

    Nevertheless – if you already know ahead of time that you’ll have to call these five Fill methods one by one, I would definitely recommend

    • opening the connection
    • reading all five data tables from the database
    • closing the connection again right away

    It’s accepted best practice to do it this way, it doesn’t hurt you – so just do it! 🙂

    Marc

    PS: Connection pooling in ADO.NET of course only works if you haven’t turned it off ! 🙂 It’s on by default – you’d have to explicitly disable it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For example I need to disable two buttons in runtime. After I disabled first
For example I need to grab from http://gmail.com/ the number of free storage: Over
A specific example I need to generate a random number between 0 and 2,
I need an example of the shortest path of a directed cyclic graph from
i need an example of the shortest path of directed graph cycle bye one
I need an example pom file to create a jar file for my spring
Tech used: PHP 5.3.10 Hi, I have an array (example below) I need to
I need a basic example of how to use the IComparable interface so that
I need a code example or library which would parse Accept-Language header and return
I've a list List<String> SampleList=new List<String>(); I need to fill a listView with the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.