How to get ConnectionStrings list programmatically in asp.net C#
Step 1) using System.Configuration;
Step 2) Get Connection Strings Stored in Web.config
foreach (ConnectionStringSettings c in ConfigurationManager.ConnectionStrings)
{
Label1.Text += "connection String:"+c.ConnectionString+" Connection String Name:"+c.Name+
" Provider Name:"+
c.ProviderName+"<br/>";
}
Step 1) using System.Configuration;
Step 2) Get Connection Strings Stored in Web.config
- Connection String
- Name Associated with connection String
- Provider Name
foreach (ConnectionStringSettings c in ConfigurationManager.ConnectionStrings)
{
Label1.Text += "connection String:"+c.ConnectionString+" Connection String Name:"+c.Name+
" Provider Name:"+
c.ProviderName+"<br/>";
}
No comments:
Post a Comment