Connection String

  • Thread starter Thread starter shapper
  • Start date Start date
S

shapper

Hello,

I need to check, from my VB.NET / C# code, if there is any connection
string defined in my Web.Config file which name starts with "Control".

If there is then I want to use it.

How can I do this?

Thanks,

Miguel
 
I need to check, from my VB.NET / C# code, if there is any connection
string defined in my Web.Config file which name starts with "Control".

If there is then I want to use it.

How can I do this?

The following is in C#, but should be easy enough to convert to VB.NET:


using System.Configuration;

foreach (ConnectionStringSettings objConnection in
ConfigurationManager.ConnectionStrings)
{
if (objConnection.ConnectionString.StartsWith("Control"))
{
// do something
}
}
 
Back
Top