How can I get the connection strings

Posted by Community Admin on 05-Aug-2018 18:58

How can I get the connection strings

All Replies

Posted by Community Admin on 05-Jan-2011 00:00

How can the a list of connection strings from sitefinitys DataConfig.config?

I cant seem to get them from this collection

ConfigurationManager.ConnectionStrings

Posted by Community Admin on 05-Jan-2011 00:00

Hi Steve,

Please try the code below

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


Regards,
Ivan Dimitrov
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.

Posted by Community Admin on 27-May-2016 00:00

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#?

Thanks.

This thread is closed