Reading Telligent's connection string from ConnectionStrings.config file

Reading Telligent's connection string from ConnectionStrings.config file

This question is not answered

Hi all,

We have a requirement where in, we need to connect to Telligent database and read some records, in our Plugin...

Is there any API or a method or anyway that we can get the connection string from ConnectionStrings.config file.

We can write custom code to load and parse that xml file, and read the connection string, but just wanted to know if there is any readily available mechanism..

Thank you.

All Replies
  • You do this the same way you would in any .NET application, using the configuration manager classes in System.Configuration:
     
    You can also store the connection information as plugin configuration which would protect you from us changing where and how we store connection information
     
    Patrick Mason
    Development Lead- Extensibility
    o: 214.420.1329
    telligent.com
     
    From: Madhu Sadlapur [mailto:bounce-Madhu_Sadlapur@communities.telligent.com]
    Sent: Tuesday, January 08, 2013 3:57 AM
    To: discussion_evolution@communities.telligent.com
    Subject: [Telligent Evolution Platform Discussion] Reading Telligent's connection string from ConnectionStrings.config file
     

    Hi all,

    We have a requirement where in, we need to connect to Telligent database and read some records, in our Plugin...

    Is there any API or a method or anyway that we can get the connection string from ConnectionStrings.config file.

    We can write custom code to load and parse that xml file, and read the connection string, but just wanted to know if there is any readily available mechanism..

    Thank you.

  • HI Patrick,

    Thanks for your response.

    1. Configuration manager would be helpful if the connection string is in the web.config or app.config file. Since Telligent's connection string is in ConnectionStrings.Config file, we had to write custom code to traverse that XML file and get that value.

    2. I did not understand your second point.

    -->  You can also store the connection information as plugin configuration which would protect you from us changing where and how we store connection information

    - can you please elaborate it?

  • The connectionstring is in the web.config file.  If you look in the web.config file, you'll see the connectionStrings section is delegated to the connectionStrings.config file

       <connectionStrings configSource="connectionStrings.config"/>

    You can use the standard ConfigurationManager class to access that connection string - that's how all our Core code accesses it.