nrkusa
Posts: 1
|
Posted: 03/19/2008, 3:24 PM |
|
I am using CodeCharge 4.x and c#. We are using 1 admin database and multiple user database and we have 1 connectionstring (for the admin db) coded in the web.config file.
After the user login to the admin db using the connectionstring, we get the users database, server info and redirect them to another database.
I was thinking this can be done by placing a second connectionstring in the web.config and in runtime, I would modify the database name, server, user id and password.
Is this possible?
If so, could someone post a snippet or some guidance.
Thanks
Raj
|
|
|
Tuong Do
|
Posted: 03/19/2008, 6:52 PM |
|
Hi Raj,
I have done this.
You have to create two connection say
1) Admin
2) Dynamic
In the file Setting.vb
Find the line
cs.Connection =
System.Configuration.ConfigurationManager.AppSettings("DynamicString")
Then replace it with
cs.Connection =
String.Format(System.Configuration.ConfigurationSettings.AppSettings("DynamicString"),
HttpContext.Current.Session("UserConnectionString"))
Now in your program use the Admin connection to get the user connection
string
Then assign that value to the Session variable UserConnectionString
"nrkusa" <nrkusa@forum.codecharge> wrote in message
news:847e192a730fc1@news.codecharge.com...
>I am using CodeCharge 4.x and c#. We are using 1 admin database and
>multiple
> user database and we have 1 connectionstring (for the admin db) coded in
> the
> web.config file.
>
> After the user login to the admin db using the connectionstring, we get
> the
> users database, server info and redirect them to another database.
>
> I was thinking this can be done by placing a second connectionstring in
> the
> web.config and in runtime, I would modify the database name, server, user
> id and
> password.
>
> Is this possible?
> If so, could someone post a snippet or some guidance.
>
> Thanks
> Raj
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.yessoftware.com/
>
|
|
|
|