views:

359

answers:

1

I have a WCF Service which connect to Sql Server 2005 to retrieve and send data according to the method invoked.

Currently I am using a hard coded sql connection string in .cs file to create a connection.

Let me know what is the best way to use the connection string or where i place the connection string?

Please help!!

+1  A: 

Assuming that the connection string is in the web.config, you can use the DataProtectionConfigurationProvider and RSAProtectedConfigurationProvider to encrypt it.

Encrypting Connection Strings

Max