views:

321

answers:

1

I use Entity Framework and Linq to Entities. I want to encrypt the connection string and the EF has to decrypt automaticaly, How can I do it?

Thanks in advance,

Javier P. de Jorge

A: 

Use aspnet_regiis. In command line browse to (usually):

cd C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727

and type:

aspnet_regiis -pef "sectionName of web.config" "path" - to encrypt
aspnet_regiis -pdf "sectionName of web.config" "path" - to decrypt

For example:

aspnet_regiis -pef "connectionStrings" "D:\projects\HelloWorldProject"

You don't need to do anything to make L2SQL read ecrypted connection string file.

jlp