title: Personalized database Connection string for C# application
body: <p>I am trying to have a personalized database connection string for the machines i install the C# application into. I have created a database using Visual Studio but that only points the location of the database to my personal directory and that is not something general.
  Now when i try to publish the application and try to install it in some other computer, the database gives me an error that it wasnt found, which makes sense because the connection string is pointing to my personal computers directory. </p>
  
  <p>Here is part of my code: </p>
  
  <pre><code> private void button13_Click_1(object sender, EventArgs e)
   {
       try
       {
           SqlConnection con = new SqlConnection("Data Source=.\\SQLEXPRESS;AttachDbFilename=C:\\Program Files\\Hydrolec Inc\\PanelProgressLogger\\PanelProgress.mdf;Integrated Security=True;User Instance=True;");
           sda = new SqlDataAdapter(@"SELECT [Panel Progress].*
                                      FROM [Panel Progress]", con);
           fill_grid();
       }
       catch (Exception error)
       {
           label6.Text = error.Message;
       }
   }
  </code></pre>
  
  <p>Can anyone please guide me towards the right path to solve this issue and to generate a personalized connection string for every computer the database gets installed to?</p>