The connection string to the database is usually set in a configuration file. In your project, you have an app.config file that is copied to the output directory and renamed to match your application exe name, e.g. MyApplication.exe.config.
Basically, you have to change the connection string in this file after the deployment to your production environment. Later, if you don't have any changes to your config file in a new release, you don't need to overwrite it when you deploy the new release.
If you don't deploy your project very often or with a large number of different connection strings, you can carry out this step manually. If you want to automate this step, have a look at this link (as @abatishchev also wrote in the comments). However, keep in mind that the connection string contains sensitive information that might need to be encrypted. As you might deploy your application to several systems, it might not be possible to store an encrypted value in your rev environment that is valid on all target systems.