Search:
Namespaces
Discussions
.NET v1.1
Feedback
Setting Variables in Global.asax.vb
Messages
Related Types
This message was discovered on
ASPFriends.com 'aspngconfig' list
.
Thomas Derenthal
-- Moved from [aspngcommunity] to [aspngconfig] by Yannick Smits <
Click here to reveal e-mail address
> --
I want to determine which server my app is running on - dev or production -
so I can set a global connection string to the dev or production database
server. The Application_start in the global.asax.vb looks like the place to
do this. How can I test to see which server my app is running on. In the
past, under ASP, I would test in each page using the
Request.ServerVariables("SERVER_NAME"). The Request object can not be used
in the context of the Application_start.
Reply to this message...
Mark Bruce
The static property
Environment
.MachineName will give you the netbios machine name. You could
check against this value to determine which values to use for your connection string
Some limitations apply such as if you are using server clustering the node is returned.
HTH!
Mark
--- Thomas Derenthal <
Click here to reveal e-mail address
> wrote:
[Original message clipped]
__________________________________________________
Do You Yahoo!?
Yahoo! Shopping - Mother's Day is May 12th!
http://shopping.yahoo.com
Reply to this message...
System.Environment
Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us
-
Terms of Use
-
Privacy Policy
-
www.dotnet247.com