CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> .NET

 .net connectionstring

Print topic Send  topic

Author Message
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
View profile  Send private message
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/
>


Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.