Webboy2008
asked on
web.config asp.net
Assume I have the following setting in asp.net/c# application - web.
in App_Code/GetInformation.cs
I need to use the connectionstring. In GetInformation.cs, we may frequently change from test to live. How can we code in asp.net/c# that we can easily just switch one time for all codes in getinformation.cs?
<connectionStrings>
<add name="SqlDbConnectionTest" connectionString="Data Source=173.248.136.2122,15 33;Initial Catalog=xxx;Persist Security Info=True;User ID=sa;Password=xxx" providerName="System.Data. SqlClient" />
</connectionStrings>
<add name="SqlDbConnectionLive" connectionString="Data Source=173.248.136.2122,15 33;Initial Catalog=xxx;Persist Security Info=True;User ID=sa;Password=xxx" providerName="System.Data. SqlClient" />
</connectionStrings>
in App_Code/GetInformation.cs
I need to use the connectionstring. In GetInformation.cs, we may frequently change from test to live. How can we code in asp.net/c# that we can easily just switch one time for all codes in getinformation.cs?
<connectionStrings>
<add name="SqlDbConnectionTest"
</connectionStrings>
<add name="SqlDbConnectionLive"
</connectionStrings>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Another question if you have time