title: SQLite 3 and Odbc Data Srource Name
body: <p>Respect,</p>
  
  <p>How to connect sqlite database from c# over Odbc connection string. I want to connect over data srouce name so I dont want use absolute path for DB. I have created ODBC DSN with Data Soruce Name "TestOdbc" and Data Base Name is full path to my sqlite test.db whic is located at C:\Test\test.db. In test.db is one table TestTable with few records.</p>
  
  <p>I try to use ODBCConnection in c# and SqliteConnection too but I have no luck. With SqliteConnection I establish connection but but the connection was not established to C:\Test\test.db I think new database is created only in :memory because when I try to select records from TestTable I got error that table does not exist.</p>
  
  <p>Please any sugesstion?</p>
  
  <p>Code:</p>
  
  <pre><code>try
          {
              SQLiteConnection conn = new SQLiteConnection();
              conn.ConnectionString = "Driver=SQLite3 ODBC Driver;Datasource=TestOdbc;";
              conn.Open();
  
              SQLiteCommand comm = new SQLiteCommand();
              comm.Connection = conn;
              comm.CommandText = "SELECT * FROM TestTable";
              SQLiteDataReader created = comm.ExecuteReader();
              comm.Dispose();
              conn.Close();
              Console.WriteLine("connection opened!!!");
          }
          catch(SQLiteException ex)
          {
  
              Console.WriteLine(ex.Message);
          }
          catch(InvalidOperationException ex)
          {
              Console.WriteLine(ex.Message);
          }
  </code></pre>