|
 |
aspx thread: request.ServerVariables("SERVER_NAME")
Message #1 by "Shelley" <shelleybobelly@y...> on Tue, 25 Feb 2003 22:35:50
|
|
Hey,
I am trying to get the server name and then base my SQL connection string
on the web server name. Anyone know how to do this in .NET??
Message #2 by "Dave Rezoski" <daverezoski@h...> on Tue, 25 Feb 2003 22:29:00 +0000
|
|
this works in C#
this.Page.Request.ServerVariables["SERVER_NAME"];
----Original Message Follows----
From: "Shelley" <shelleybobelly@y...>
Reply-To: "ASP.NET" <aspx@p...>
To: "ASP.NET" <aspx@p...>
Subject: [aspx] request.ServerVariables("SERVER_NAME")
Date: Tue, 25 Feb 2003 22:35:50
Hey,
I am trying to get the server name and then base my SQL connection string
on the web server name. Anyone know how to do this in .NET??
_________________________________________________________________
STOP MORE SPAM with the new MSN 8 and get 2 months FREE*
http://join.msn.com/?page=features/junkmail
Message #3 by "Shelley" <shelleybobelly@y...> on Tue, 25 Feb 2003 22:44:40
|
|
> Hey,
I> am trying to get the server name and then base my SQL connection
string
o> n the web server name. Anyone know how to do this in .NET??
...Me again, I should elaborate. I would like to get this in the code-
behind, then base the connection string on what the web server name is. So
I can run the same identical code on test and production servers, pointing
either to test or production SQL server. I can do it in the web.config,
just hard code the connection string, but that means a different
web.config on each server.
|
|
 |