In my web.config file I have a databse connection string and the password is also defined in the connection string.
When I generate the edmx file I get option to store password in connection string or to define it manually in application code to make it more secure. How do you define it in application code and reference that in the connection string?
you can put your edmx in an external class with an app-config value of your connection string and then reference that class seperate from your website in your web.config. i prefer this way because the library of your edmx is just a .dll reference
GStar99
Member
13 Points
160 Posts
Password security in connection string
Nov 04, 2012 02:41 PM|LINK
In my web.config file I have a databse connection string and the password is also defined in the connection string.
When I generate the edmx file I get option to store password in connection string or to define it manually in application code to make it more secure. How do you define it in application code and reference that in the connection string?
BrockAllen
All-Star
27554 Points
4912 Posts
MVP
Re: Password security in connection string
Nov 04, 2012 02:57 PM|LINK
It's not really any more secure in the application code.
Look into encrypting sections in web.config if you're really concerned about protecting those values:
http://msdn.microsoft.com/en-us/library/ms254494.aspx
DevelopMentor | http://www.develop.com
thinktecture | http://www.thinktecture.com/
Xequence
Contributor
4313 Points
1528 Posts
Re: Password security in connection string
Nov 05, 2012 02:45 AM|LINK
you can put your edmx in an external class with an app-config value of your connection string and then reference that class seperate from your website in your web.config. i prefer this way because the library of your edmx is just a .dll reference
Credentials