More in this section
Forums / Sitefinity SDK / How can I get the connection strings

How can I get the connection strings

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
3 posts, 0 answered
  1. Steve
    Steve avatar
    3037 posts
    03 Dec 2008
    05 Jan 2011
    Link to this post
    How can the a list of connection strings from sitefinitys DataConfig.config?

    I cant seem to get them from this collection
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    12 Sep 2017
    05 Jan 2011
    Link to this post
    Hi Steve,

    Please try the code below

    var dataConfig = Config.Get<DataConfig>();
    var cs = dataConfig.ConnectionStrings;

    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. jason
    jason avatar
    3 posts
    04 May 2009
    27 May 2016 in reply to Ivan Dimitrov
    Link to this post

    What is the required reference for DataConfig? 

    The type or namespace name 'DataConfig' could not be found (are you missing a using directive or an assembly reference?)


    I want to access the Sitefinity database connection string from Data.Config.

    Or otherwise, how can I query the database directly from c#?


3 posts, 0 answered