473,473 Members | 1,534 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Application[] storage issue

Hello,

I am creating a dbConnection for use through out my application and
storing it in an Application variable. I am doing this in the
Application_Start event in the Global.asax file. The first time the app
is run and a page needs this variable, Application["connection"]
returns null. Subsequent calls to the application work fine. This only
happens on the first run. Is there a better way? Is this some sort of
bug?

Thanks

Curt

Nov 19 '05 #1
2 946
I'd have to see the code to know exactly what is wrong, but I'd
suggest not taking this approach. You don't want to share a connection
among multiple requests - it will eventually break in mysterious ways.

Open a new connection when you need one and close it as soon as you
are done. The runtime will take care of keeping things running
efficiently.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On 4 Nov 2005 11:22:13 -0800, "Curt tabor" <ct****@oneil.com> wrote:
Hello,

I am creating a dbConnection for use through out my application and
storing it in an Application variable. I am doing this in the
Application_Start event in the Global.asax file. The first time the app
is run and a page needs this variable, Application["connection"]
returns null. Subsequent calls to the application work fine. This only
happens on the first run. Is there a better way? Is this some sort of
bug?

Thanks

Curt


Nov 19 '05 #2
OK. Thanks.

Curt

Nov 19 '05 #3

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

Similar topics

3
by: Edmond Neo | last post by:
I use structured storage to store large amounts of data in various streams. I realize that I can call structured storage through a wrapper in .NET, but I'm concerned that there is a performance...
13
by: S.Tobias | last post by:
I'm examining the existence of temporary objects by looking at their addresses. The trick is to create a structure that contains an array as its first member. In an expression the array rvalue...
9
by: CptDondo | last post by:
I am working on an embedded platform which has a block of battery-backed RAM. I need to store various types of data in this block of memory - for example, bitmapped data for control registers,...
8
by: Anthony P. Mancini | last post by:
I'm working on a proof of concept that will ultimately be deployed on a load balancer. For the sake of a preliminary demonstration I created a C# object and marked it's attributes as Public...
8
by: ma740988 | last post by:
Consider this statement in Excel's text Thinking in C++, Vol 2: /// 1 " A vector starts by grabbing a block of storage, as if it's taking a guess at how many objects you plan to put into it. ...
1
by: beachboy | last post by:
how can pass the login (security info) to secondary application? ASP.NET 1.1 user login to application 1(app1.myapp.com) with their username and password, then they have a link to application 2...
11
by: Olie | last post by:
This post is realy to get some opinions on the best way of getting fast comunication between multiple applications. I have scowered the web for imformation on this subject and have just found...
2
by: illegal.prime | last post by:
Hi all, I would like to find a standard place to put application data, but I don't want the pathname to include the application's version. Any suggestions? Thanks, Novice
2
by: jphelan | last post by:
Ever since I successfully applied some techniques for increasing the speed of my 17 meg. Application; it has only made me hunger for more. First, let me list what I have done so far: 1. Split...
4
by: nishanthancp | last post by:
Hi, Our Web server runs Windows 2003 Server, IIS6.0, ASP.Net 2.0. We randomly get "Server Application Unavailable" error. The event log says "Failed to execute request because the App-Domain...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.