Click here to Skip to main content
15,904,817 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi....


Good evening...

I have develop a website in asp.net 3.5.I want to change the connection string in dynamic by user selection financial year one Database to Another database.I have use web.config for Default database.
XML
<appSettings>
        <add key="conInfo" value="Data Source=SERVER;Initial Catalog=Tryal_DB;User Id=sa;Password=dev12345"/>
    </appSettings>



and use a code

C#
public class ConnectionInfo
    {
        public static string info
        {
            get
            {
                return ConfigurationSettings.AppSettings["conInfo"];
            }
        }
   }


How to change a connection string a one database to another database by user login.
Please help me.

Thank You,
Debapriya
Posted
Updated 15-Mar-11 3:38am
v2

1 solution

Change it using IF clause whats the issue and , make more connecting string in Web.Config file !
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900