< connectionStrings >
< add name="myconn" connectionString="Data Source=*****;Initial Catalog=Excentive;User ID=*****;Password=*****;MultipleActiveResultSets=True" providerName="System.Data.SqlClient" / >
< / connectionStrings >
In order to get connection string in a cs file:
System.Configuration.ConfigurationManager.ConnectionStrings["myconn"].ConnectionString)
If you want to add key to web.config:
< appSettings >
< add key="ServerURL" value="my_url" / >
< / appSettings >
When you want to call it in your cs file:
ConfigurationManager.AppSettings["ServerURL"]
No comments:
Post a Comment