I am using database to store my key value for appsetting and connectionstring in web.config , i see we can load ConfigurationManager from external config file like below Loading custom configuration files, Can this be done from a Database as well or a Object populated from data in db?
Asked
Active
Viewed 125 times
0
-
did you try it? – Hussein Salman Mar 22 '18 at 15:53
-
It is unclear what are you asking. What do you want to read from a database? Are you asking how to populate an object instance from a datatable record? – Steve Mar 22 '18 at 15:56
-
@Steve trying to load web.config appsetting from database, into configurationManager object, as i am storing my appsetting entry in db – Justin Homes Mar 22 '18 at 16:00
-
But how do you reach the database? Do you have hard-coded the connectionstring? This string is usually loaded from the same config that you want to read from the db. Usually one use the configuration file for basic settings and use an ad hoc table to setup the configuration for the application. – Steve Mar 22 '18 at 16:03
-
@Steve, i have a service that gets me this data as i encrypt my data in db, and yes this service url is only entry in web.config for me – Justin Homes Mar 22 '18 at 16:06