You could set the connection string as follows (air code). Then all you
have to do is run the replace command on the application to remove the
parenthesis around ("mySQLString") so that its (mySQLString). So if you had
the following 2 connection strings:
<add name="ConnectionString1" connectionString="..."/>
<add name="ConnectionString2" connectionString="..."/>
Page_Load
Dim mySQLString As String
Dim strSite As String
strSite = Request.QueryString("Site")
Select Case strSite
Case SiteA
mySQLString = "ConnectionString1"
Case SiteB
mySQLString = "ConnectionString2"
End Select
conn_str = ConfigurationSettings.AppSettings(mySQLString )
conn = New SqlConnection(conn_str)
conn.Open()
Hope this helps!
--
******************
Reggie
"Ibrahim Shameeque" <Ib**************@discussions.microsoft.comwrote in
message news:9F**********************************@microsof t.com...
Did you have a look at asp.net configuration settings under virtual
directory
properties in IIS?
Also, you could have two start pages, one for each virtual directory,
which
sets the database connection.
Thanks
---------------------------
Thanks,
Ibrahim
Software Consultant - Web Development, GB
"wild" wrote:
>On 24 Ott, 14:30, "Eliyahu Goldin"
<REMOVEALLCAPITALSeEgGoldD...@mMvVpPsS.orgwrote :
You have as many connection strings as you wish:
<connectionStrings>
<add name="ConnectionString1" connectionString="..."/>
<add name="ConnectionString2" connectionString="..."/>
</connectionStrings>
and in the code you can check the request url to decide what connection
string to use. Page.Request property points to the HttpRequest object
that
in turn provides various url-related properties.
--
Eliyahu Goldin,
Software Developer
Microsoft MVP
[ASP.NET]http://msmvps.com/blogs/egoldinhttp://usableasp.net
Thank you for your replay but I don't want to correct the code already
written in a lot of routines,
something like "Dim MyConn As New
OdbcConnection(ConfigurationSettings.AppSettings( "mySQLString"))".
I was asking if it is possible to have two different 'config' files
depending on the requesting url, and leave the code unchanged.