Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Global Variables - Visible anywhere
Message
From
17/05/2002 01:35:04
 
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00657993
Message ID:
00658000
Views:
24
>eg. 1. Connection string
>can I set the connection staring at the start of the application and then use it whenever I make a SQL connection.

Using global variables here is pretty messy, especially when it woudl break all encapsulation.

You should, in your application have a file called appname.config (or, if this hasn't been built to an EXE yet, just app.config) and is an XML file to hold this sort of thing. If your settings looked like:
<appSettings>
    <add key="key" value="value" />
</appSettings>
You shoudl be able to get that setting in the app by doing a:
string keyValue = ConfigurationSettings.AppSettings["key"];
>is it possible to have a Global Error Handler as In VFP.

Hmmm, not quite. With structured error handling there shoudl be little need for this. I think this question was asking in this forum before, take a look for those threads and you shoudl get an idea on how to use TRY...CATCH to work globally.
Previous
Reply
Map
View

Click here to load this message in the networking platform