473,503 Members | 8,959 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with Application Variables

I think this is probably a relatively simple problem, but I can't
figure it out. I have an app that uses an Application variable to
store my DB connection string. The object is created as so:

Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
Application("datacon") = "My Connection String"
End Sub

When I run the page that uses this App Object on my local IIS 5.1
server everything works fine. However when I try to run it on our
production IIS 6.0 server the Application variable has no value. I
have no idea why this is happening. Can anyone help?

Nov 20 '05 #1
3 1077
Save connection strings like recommend in the web.config

--
Daniel Fisher(lennybacon)
http://www.lennybacon.com
"coynej60" <ja********@yahoo.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
I think this is probably a relatively simple problem, but I can't
figure it out. I have an app that uses an Application variable to
store my DB connection string. The object is created as so:

Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
Application("datacon") = "My Connection String"
End Sub

When I run the page that uses this App Object on my local IIS 5.1
server everything works fine. However when I try to run it on our
production IIS 6.0 server the Application variable has no value. I
have no idea why this is happening. Can anyone help?

Nov 20 '05 #2
What is the benefit of placing in Web.Config vs. Global.asax? I have
heard that it is more effiecient to place in Global.asax. I figured
out what my problem was, and it works now, just curious what the
benefits are to using Web.Config vs. Global.asax.

thank you for your reply

Jake

Nov 20 '05 #3
re:
curious what the benefits are to using Web.Config vs. Global.asax.
None. Both files are loaded into memory when the application starts.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"coynej60" <ja********@yahoo.com> wrote in message
news:11*********************@g44g2000cwa.googlegro ups.com... What is the benefit of placing in Web.Config vs. Global.asax? I have
heard that it is more effiecient to place in Global.asax. I figured
out what my problem was, and it works now, just curious what the
benefits are to using Web.Config vs. Global.asax.

thank you for your reply

Jake

Nov 20 '05 #4

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

Similar topics

1
4333
by: mark4asp | last post by:
What are the best methods for using global constants and variables? I've noticed that many people put all global constants in a file and include that file on every page. This is the best way of...
4
3772
by: Martin Ho | last post by:
Hey Everyone, I really hope there is someone who can figure out this problem. Honestly, I spent 3 days now trying to find the solution, but nothing works. I'll try to explain the problem...
7
2297
by: Adam Short | last post by:
I'm having all sorts of problems with Sessions, I've been using them for years with out a hitch, all of a sudden the last 6 - 12 months since getting our new Win2003 server it's all gone shakey!!!...
6
6403
by: Garfield | last post by:
We have written a small function to append a couple of paths to the path environmental variable. The code is: string PathValue = ""; string sAdd = ""; sAdd = ";" + <path1> + "Bin;" +...
1
1184
by: shalin | last post by:
I am having a strange problem in my ASP.NET application. When multiple users access the web site, the changes done by a user gets reflected in another users session. I have some global...
0
1439
by: Alexander Widera | last post by:
hello all, i have a problem ... like I already discussed in the thread "session empty" I have the following problem: I created a completely new web... i added 2 files: sessiontest1.aspx:
2
337
by: fizbang | last post by:
This should be impossible, but for some reason, people are not getting individual sessions. They start a session. I set the session("application") variable to the unique number generated by an...
6
8195
by: S Wheeler | last post by:
I have a REALLY nasty problem and could use some expert help. I have two mixed mode apps. Each uses a mixed mode DLL that exports a couple of classes. There is no dll main as it is not needed....
14
2273
by: GaryDean | last post by:
The web.config in my asp.net application, running on Server2003, has this entry: <sessionState mode="InProc" timeout="40". In IIS the asp.net State Management timeout setting is 40 for my website....
6
3511
by: efrenba | last post by:
Hi, I came from delphi world and now I'm doing my first steps in C++. I'm using C++builder because its ide is like delphi although I'm trying to avoid the vcl. I need to insert new features...
0
7207
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
7095
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7361
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
7015
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
7470
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
5602
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,...
0
4693
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1523
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 ...
0
403
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.