Connection String

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • shapper

    #1

    Connection String

    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

  • Mark Rae

    #2
    Re: Connection String

    "shapper" <mdmoura@gmail. comwrote in message
    news:1174563838 .160002.39410@p 15g2000hsd.goog legroups.com...
    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.Configur ation;

    foreach (ConnectionStri ngSettings objConnection in
    ConfigurationMa nager.Connectio nStrings)
    {
    if (objConnection. ConnectionStrin g.StartsWith("C ontrol"))
    {
    // do something
    }
    }



    Comment

    Working...