How to deploy C# windows application (setup file) with database and how to manage connection string on client machine
<p>I am creating C# <em>Windows Application</em> in <strong>Visual Studio 2015</strong>.</p>

<p><strong>Question:</strong></p>

<p>How to deploy C# Windows Application (setup file) with SQL Server database with database connection string.</p>

<p>I create common connection string in <strong>app.config</strong> :</p>

<pre><code>&lt;connectionStrings&gt;
      &lt;add name="conString" 
           providerName="System.Data.sqlclient"          
           connectionString="Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=
                 'C:\Users\DEVELOPERS\Documents\Visual Studio 2015\Projects\Provision1\
                  Provision1\provision1.mdf';Integrated Security=True"/&gt;

&lt;/connectionStrings&gt;
</code></pre>

<p>Now connection string path location shows my machine. </p>

<p>Then after installation <strong>.exe</strong> how to connect database and how to manage connection string on client machine.</p>

<p><a href="https://i.stack.imgur.com/EVFT4.png" rel="nofollow"><img src="https://i.stack.imgur.com/EVFT4.png" alt="enter image description here"></a></p>