Creating sqlite database using dump file programmatically
<p>I've created a dump file from a Sqlite database and I want to create another sqlite database based on this file in my <code>C#</code> application.</p>

<p><em>a sample of the dump file:</em></p>

<pre><code>drop table if exists [main].[tblAyah];

CREATE TABLE [main].[tblAyah] (
  [IdAyah] INTEGER NOT NULL PRIMARY KEY ON CONFLICT REPLACE AUTOINCREMENT, 
  [AyahNumber] INTEGER, 
  [Page] INTEGER);

insert into [main].[tblAyah] values(1, 1, 1, 'somthing','somthing');
...
</code></pre>

<p>So My question is:</p>

<p>Is there a particular way to do that or I just have to read the file as string and run each command line one by one like this:</p>

<pre><code>IEnumerable&lt;string&gt; tblCommand;
//Reading the dump file line by one and adding to tblCommand
using (SqlCeConnection con = new SqlCeConnection(
"DataSource=\"|DataDirectory|\\newDb.db\";Persist Security Info=False;"))
{
    con.Open();
    foreach (string command in tblCommand)
    using (SqlCeCommand com =
    new SqlCeCommand(command, con))
    {
        com.ExecuteNonQuery();
    }

    con.Close();
}
</code></pre>