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

  • Home
  • SEARCH
  • 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 952473
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T23:53:58+00:00 2026-05-15T23:53:58+00:00

I am using ADO.Net for some database connectivity and I was just hoping I

  • 0

I am using ADO.Net for some database connectivity and I was just hoping I was doing it the right way. I am opening and closing multiple connections for each stored procedure. Or should I be wrapping this up in just one open connection (less resource on the database maybe?) thanks, and if there is anything odd or something I could be doing better let me know thanks!

Example: this but I have like 6 of them…

using (SqlConnection conn = new SqlConnection(ConnectionString))
{
    SqlCommand cmd = new SqlCommand("spSelectAllTrip", conn);
    cmd.CommandType = CommandType.StoredProcedure;
    conn.Open();
    ddlTripTypeA.DataSource = cmd.ExecuteReader();
    ddlTripTypeA.DataTextField = "TripType";
    ddlTripTypeA.DataValueField = "TripTypeAID";
    ddlTripTypeA.DataBind();
}
using (SqlConnection conn = new SqlConnection(ConnectionString))
{
    SqlCommand cmd = new SqlCommand("spSelectAllTripB", conn);
    cmd.CommandType = CommandType.StoredProcedure;
    conn.Open();
    ddlTripTypeB.DataSource = cmd.ExecuteReader();
    ddlTripTypeB.DataTextField = "TripType";
    ddlTripTypeB.DataValueField = "TripTypeBID";
    ddlTripTypeB.DataBind();
}
  • 1 1 Answer
  • 1 View
  • 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-15T23:53:59+00:00Added an answer on May 15, 2026 at 11:53 pm

    .Net has connection pooling already managed for you so you don’t need to worry about reusing connections like you might have with old asp. I always go with several small quick calls vs keeping one open the whole time because not all the time it’s open is generally used for calls. You have your site code running doing some things between as well.

    Now if you are going to make 6 consecutive calls one after another then it might make sense to open one and reuse. But other than that I say just stick with what you are doing.

    The only thing you might want to look into is a connection manager so that you aren’t having to create the connection object in .net over and over again. But that doesn’t have anything to do with db connections vs just object creation.

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

Sidebar

Related Questions

Just some background, sorry so long winded. I'm using the System.Data.SQLite ADO.net adapter to
I have some existing code that retrieves data from a database using ADO.NET that
I'm using ADO.NET entity framework, and am using an AdventureWorks database attached to my
I am inserting values in to Database from a Webform using ADO.NET, C#. DB
i am using ADO.Net oledb for inserting and fetching data from Excel database. I
I've got a vb.net codebase using ado to connect to an Oracle database. We
I'm using an ADO.net provider of SQLite. I want to steer around some of
I am using ADO.Net for connecting to some Sql Server and Oracle databases, and
I am doing some performance tests using .Net 3.5 against SQL Server. I am
I am using an ADO .Net Entity Model for querying a MySQL database. I

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.