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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:15:54+00:00 2026-05-28T02:15:54+00:00

I have started developing a full-web application by using the ASP .NET MVC 3

  • 0

I have started developing a full-web application by using the ASP .NET MVC 3 framework.
I am a MVC 3 beginner developer.

On the server-side I am going to execute some queries to a DB.
Consequently I will have to make a connection to the DB.

I would like to know if it is better to make a connection in the beginning of each action method or in an event handler.
I have thought about making the connection in the Application_Start event handler and then storing an object representing my connection into the application state.
Does this way present disadvantages ?

Thanks in advance for your future answer

  • 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-28T02:15:55+00:00Added an answer on May 28, 2026 at 2:15 am

    Open and close the connection as required (rather than keeping one open). Let connection pooling work for you.

    10 Tips for Writing High-Performance Web Applications (ASP.NET but contains relevant advice):

    Tip 3—Connection Pooling

    Setting up the TCP connection between your Web application and SQL
    Server™ can be an expensive operation. Developers at Microsoft have
    been able to take advantage of connection pooling for some time now,
    allowing them to reuse connections to the database. Rather than
    setting up a new TCP connection on each request, a new connection is
    set up only when one is not available in the connection pool. When the
    connection is closed, it is returned to the pool where it remains
    connected to the database, as opposed to completely tearing down that
    TCP connection.

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

Sidebar

Related Questions

I have just started developing a full-web application by using the ASP .NET MVC
We are developing our new application in .Net 3.5 and we have started using
I've started developing a website in ASP.NET MVC and have taken part in the
I have started developing a new Rails app on my server using RVM, Rails
I started developing my rails application using sqlite. I have reached a point where
At work we have just started developing in C#.NET using VS2008 and we need
I have recently started using Zend Framework. I started developing on my local XAMPP
I started developing an application for a FEZ Panda device, using the .NET Micro
I have started developing a drawing application in as3. I am thinking that I
I have just started developing using Youtube API and stuck in very beginning. 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.