title: Add SQLite database directly to Zip file
body: <p>I am trying to create an SQLite database in memory and then add it directly to a zip file I have created. So far I can create the zip file using the <a href="https://msdn.microsoft.com/en-us/library/system.io.compression.ziparchive%28v=vs.110%29.aspx" rel="nofollow">ZipArchive</a> and <a href="https://msdn.microsoft.com/en-us/library/system.io.compression.zipfile%28v=vs.110%29.aspx" rel="nofollow">ZipFile</a> classes. However, I cannot find a way to add an SQLite database I have created in memory to the zip container.</p>
  
  <p>Following is the code I have to create the database in memory:</p>
  
  <pre><code>private static void MemoryDB()
          {
              SQLiteConnection conn = new SQLiteConnection("Data Source = :memory:");
              conn.Open();
  
              String sql = "CREATE TABLE highscores (name VARCHAR(25), score INT)";
              SQLiteCommand command = new SQLiteCommand(sql, conn);
              command.ExecuteNonQuery();
  
              // Insert Data
              sql = "INSERT INTO highscores (name, score) VALUES ('Jennie', 98)";
              command = new SQLiteCommand(sql, conn);
              command.ExecuteNonQuery();
  
              sql = "INSERT INTO highscores (name, score) VALUES ('Michael', 42)";
              command = new SQLiteCommand(sql, conn);
              command.ExecuteNonQuery();
  
              sql = "INSERT INTO highscores (name, score) VALUES ('Jason', 76)";
              command = new SQLiteCommand(sql, conn);
              command.ExecuteNonQuery();
  
              // Select Data
              sql = "SELECT * FROM highscores ORDER BY score desc";
              command = new SQLiteCommand(sql, conn);
              SQLiteDataReader reader = command.ExecuteReader();
              while (reader.Read())
                  Console.WriteLine("Name: " + reader["name"] + "\tScore: " + reader["score"]);
  
              conn.Close();
          }
  </code></pre>
  
  <p>I have been able to create a normal database on disk and add that to the zip container with the ZipArchive.CreateEntryFromFile() method and then deleting the database, but it looks very bad when you can see the databases being created and then removed.</p>
  
  <p>There must be a better way?</p>
  
  <p>Thanks,</p>