title: Losing Sqlite tables when deploying to on Monodroid
body: <p>We are using Visual Studio 2010, Monodroid and SQLite</p>
  
  <p>We create a database at path myContext.GetDatabasePath("mydb.db3").AbsolutePath using the SqliteConnection.CreateFile(...) method.</p>
  
  <p>So our connection string is "Data Source=/data/data/myapp.myapplication/databases/mydb.db3temp;"</p>
  
  <p>We create a table and insert several records using SqliteCommand.ExecuteNonQuery().</p>
  
  <p>We can run select queries with SqliteCommand.ExecuteScalar() immediately after inserting.</p>
  
  <p>SqliteDataAdapter.Fill(table) method does not run successfully and gives us this exception:</p>
  
  <pre><code>System.EntryPointNotFoundException: sqlite3_column_origin_name
   at (wrapper managed-to-native) Mono.Data.Sqlite.UnsafeNativeMethods:sqlite3_column_origin_name (intptr,int)
   at Mono.Data.Sqlite.SQLite3.ColumnOriginalName (Mono.Data.Sqlite.SqliteStatement stmt, Int32 index) [0x00000] in &lt;filename unknown&gt;:0 
   at Mono.Data.Sqlite.SqliteDataReader.GetSchemaTable (Boolean wantUniqueInfo, Boolean wantDefaultValue) [0x00000] in &lt;filename unknown&gt;:0 
   at Mono.Data.Sqlite.SqliteDataReader.GetSchemaTable () [0x00000] in &lt;filename unknown&gt;:0 
   at System.Data.Common.DataAdapter.BuildSchema (IDataReader reader, System.Data.DataTable table, SchemaType schemaType, MissingSchemaAction missingSchAction, MissingMappingAction missingMapAction, System.Data.Common.DataTableMappingCollection dtMapping) [0x00000] in &lt;filename unknown&gt;:0 
   at System.Data.Common.DataAdapter.BuildSchema (IDataReader reader, System.Data.DataTable table, SchemaType schemaType) [0x00000] in &lt;filename unknown&gt;:0 
   at System.Data.Common.DataAdapter.FillTable (System.Data.DataTable dataTable, IDataReader dataReader, Int32 startRecord, Int32 maxRecords, System.Int32&amp; counter) [0x00000] in &lt;filename unknown&gt;:0 
   at System.Data.Common.DataAdapter.FillInternal (System.Data.DataTable dataTable, IDataReader dataReader) [0x00000] in &lt;filename unknown&gt;:0 
   at System.Data.Common.DataAdapter.Fill (System.Data.DataTable dataTable, IDataReader dataReader) [0x00000] in &lt;filename unknown&gt;:0 
   at System.Data.Common.DbDataAdapter.Fill (System.Data.DataTable dataTable, IDbCommand command, CommandBehavior behavior) [0x00000] in &lt;filename unknown&gt;:0 
   at System.Data.Common.DbDataAdapter.Fill (System.Data.DataTable dataTable) [0x00000] in &lt;filename unknown&gt;:0 
   at (wrapper remoting-invoke-with-check) System.Data.Common.DbDataAdapter:Fill (System.Data.DataTable)
   at ...
  </code></pre>
  
  <p>If we make any changes to the application code and redeploy, then the db file still exists on the android device but SqliteCommand.ExecuteScalar() and SqliteDataAdapter.Fill(table) will throw exceptions that say that the table does not exist:</p>
  
  <pre><code>Mono.Data.Sqlite.SqliteException: SQLite error
  no such table: MyTable
   at Mono.Data.Sqlite.SQLite3.Prepare (Mono.Data.Sqlite.SqliteConnection cnn, System.String strSql, Mono.Data.Sqlite.SqliteStatement previous, UInt32 timeoutMS, System.String&amp; strRemain) [0x00000] in &lt;filename unknown&gt;:0 
   at Mono.Data.Sqlite.SqliteCommand.BuildNextCommand () [0x00000] in &lt;filename unknown&gt;:0  
  </code></pre>
  
  <p>Is this expected Monodroid behavior?  Should we lose the tables after re-deploying the application?  How should we use SqliteDataAdapter.Fill()?</p>
  
  <p>Thanks</p>