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 961545
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T01:21:44+00:00 2026-05-16T01:21:44+00:00

I am making multiple queries to a database over a short period continiously. In

  • 0

I am making multiple queries to a database over a short period continiously.
In the past I have always closed the connection and reopened when I needed to talk to sqlserver again – this served me well. But now when I try to do this over a very short period I get no connections availible messages. I then thought I would just try and keep the connection open for the life of the application, so far so good I haven’t run into any problems. I am just wondering what others think of this approch…am I on a short road to disaster?

One other thing I have nocied that I really don’t have to call connection open() method, the connection just seem to work without the call – what’s the deal with that?

void main()
{
SqlConnection cn = new SqlConnection();
cn.ConnectionString = <connection>;
tmr.interval=100;
tmr.Elapsed += new System.Timers.ElapsedEventHandler(tmr_Elapsed);
}

void tmr_elapsed()
{
tmr.Enabled = false;
SqlDataAdapter da = new SqlDataAdapter(query, cn);
da.Fill(dt);
tmr.Enabled = true;
}

C#, sql-server 2000, .net 2.0

  • 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-16T01:21:45+00:00Added an answer on May 16, 2026 at 1:21 am

    The connection object associated with the SELECT statement must be valid, but it does not need to be open. If the connection is closed before Fill is called, it is opened to retrieve data, then closed. If the connection is open before Fill is called, it remains open.

    For more information look at this question.

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

Sidebar

Related Questions

I have a paginated collection that could be simultaneously making multiple fetch()es. E.G. a
I am making an application which will have an interface similar to Photoshop: multiple
I am making a simple timer app. I have a uitable with multiple rows.
I have a question regarding db queries inside of a foreach loop. Im making
I'm making a webapp where they'll be multiple users interacting with each other and
I'm making an app that will be installed and run on multiple computers, my
I'm making an application that requires the use of multiple textFields with number pads
so i've had multiple problems with a tic tac toe game i'm making, but
What is the better way of making full use of multiple cores for parallel
I'm making a small online game, where (what do you know) there'll be multiple

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.