title: How to specify a relative SQLite database path in C#?
body: <p>My database is located outside the application folder
  Example: </p>
  
  <p>Database: <code>SampleApplication\Database\Database.sqlite</code></p>
  
  <p>Application: <code>SampleApplication\Application\program.cs</code></p>
  
  <p>My code is as below.</p>
  
  <pre><code>string relativePath = @"SampleApplication\Database\Database.sqlite";
  string currentPath;
  string absolutePath;
  string connectionString;
  currentPath = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase);
  absolutePath = Path.Combine(currentPath, relativePath);
  connectionString = string.Format("Data Source={0};Version=3;Pooling=True;Max Pool Size=100;", absolutePath);
  m_dbConnection = new SQLiteConnection(connectionString);
  m_dbConnection.Open();
  </code></pre>