2

How can I secure the communication between a C# program running locally on my computer and a SQL Server in a hosted environment?

I have an asp.net application that is secured by SSL encryption. So using the asp.net from an open wlan connection is no problem.

How can I achieve the same kind of encryption for my administrative tool? Would it be best to write a service? But how would that connection to the service be secured?

1 Answer 1

2

You should be able to simply specify encryption in the connection string like so:

Provider=SQLNCLI10.1;Integrated Security=SSPI;Persist Security Info=False
;Initial Catalog="Foo";Data Source=(local);Use Encryption for Data=True;

This connection string uses the Native Client and a trusted connection but obviously can be adjusted for a SQL username and password.

For more, see the "Enable encryption for a specific client" section of this KB article. You have to ensure that the client has the server's certificate in its Trusted Root Certification Authorities folder. Here is another article.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.