here's what the appSettings section of your web.config could look like:
<configuration>
<appSettings>
<add key="DSN" value="Server=(local);Database=DBName;UID=sa;PWD="/>
<add key="OtherConnectionString" value="Server=(local);Database=DBName2;UID=sa;PWD= "/>
</appSettings>
</configuration>
This is a nice way to manage it. You can change the connection string
easily without rebuilding the app or restarting IIS or anything, and the
change goes into effect immediately.
Then in your code behinds you can get the connection string like this:
Dim sConn as string
If User = UserA Then
sConn = ConfigurationSettings.AppSettings("DSN")
Else
sConn = ConfigurationSettings.AppSettings("OtherConnection String")
End If
--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"kb" <> wrote in message news:%...
ASP.NET C#
how can i set this up:
i have a login page
if i login as clientA then i want to use clientA database
if i login as clientB then i want to use clientB database
both databases are on the same sql server, iam thinking could i have a dynamic connection sting in the web.config or somewhere else? so i would have something like this:
Persist Security Info=False;Data Source=local;Initial Catalog= + databaseNameGoesHere +;User ID=user;Password=pwd
any suggestions would be much appriciated
thanks
kb