Use appsettings connectionstring instead of connectionStrings in web config for datacontext designer
I need to use the appsettings/key for my connection string in a web project, and want to re-use this for my connectionstring in the datacontext designer, but it seems all I can use there is the web.config's connectionStrings, so I have to have my DB location in 2 places in the web.config, how can I force t开发者_运维百科he designer (dbml) to use the appsettings instead?
You can pass the connection string into the datacontext constructor.
So you get it from the location you like and pass it in onstructor.
精彩评论