title: How to get root path for winforms
body: <p>I am using access db which is in bin/debug folder and use it in code like</p>
  
  <pre><code>    private static string **_strCon** = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + 
  ***Application.ExecutablePath.ToString().Substring(0, 
  Application.ExecutablePath.ToString().LastIndexOf('\\')) +
   "\\Reporting.accdb***;Jet 
  
  OLEDB:Database Password=abc;";
  </code></pre>
  
  <p>and for reports I use DataSet which is using connectionstring from app.config like</p>
  
  <pre><code>    &lt;add name="GarzaReportingSystem.Properties.Settings.ReportingConnectionString" 
  
  connectionString="Provider=Microsoft.ACE.OLEDB.12.0;***Data Source=|DataDirectory|\bin
  
  \Debug\Reporting.accdb***;Persist Security Info=True;Jet OLEDB:Database Password=abc" providerName="System.Data.OleDb"/&gt;
  </code></pre>
  
  <p><strong>PROBLEM:</strong></p>
  
  <p>When I make setup of the project and than install the application. I need to put Reporting.accdb in root folder in order for my forms to work using _strCon. In Other words my Executable path becomes root folder</p>
  
  <p>But for DataSet</p>
  
  <p>I need to put access db in bin/debug folder for it to work when application is installed.</p>
  
  <p>How to solve this problem so both resolve same path like root has folder DataBase and both use that path.</p>