locked
CloudConfigurationManager.GetSetting RRS feed

  • Question

  • User1080785583 posted

    How can I use this to pull my values from a database instead of a file?

    Thursday, February 20, 2014 5:59 PM

All replies

  • User-376018714 posted

    Hi

    You cannot. Because the CloudConfigurationManager is used to read the config files of your web role or worker role or that of your azure websites configuration settings. This cannot connect to a database rather it provides access to the config file in azure environment.

    you can read more about the CloudConfigurationManager class here: http://msdn.microsoft.com/en-us/library/windowsazure/microsoft.windowsazure.cloudconfigurationmanager.aspx

    if you are using  database to store your application configuration - then you will need to use ADO.NET to execute sql queries to retrieve the data yourself or you can use an ORM like EF to map the database to C# objects and the ORM will do the sql query execution for you.

    Monday, March 31, 2014 3:39 AM