0

Can I load a disk-database file (.db) to a in-memory database created by :memory: in Sqlite? I am using Mono, and Mono.Data.Sqlite is the library I am linking to. Does anyone know how to do that? or can anyone point me to a document for this library? Thanks!

-gb

gambellhq
  • 3
  • 2

1 Answers1

1

you should use the SQLite Backup API. here is a couple of links.

Using the SQLite Online Backup API

Online Backup API

Cesar A. Rivas
  • 1,355
  • 1
  • 10
  • 13
  • Thanks for your reply! The problem is all those functions are C functions. But what I can use in Mono is an ADO.Net provider and has no functions as these... – gambellhq Feb 27 '11 at 02:26
  • @gambellhq, if you want to take advantage of SQLite specific features you'll need to use SQLite specific code, not just standard ADO.NET APIs. Even if Mono doesn't expose these functions, you can call them directly with the right pinvoke calls (we do this with SQLite on Windows in .NET, so I assume Mono would work the same). – Samuel Neff Feb 27 '11 at 02:33
  • @Samuel, thanks! I am new to Mono and Sqlite, can you give a brief example about how I can make pinvoke calls to its C function? – gambellhq Feb 27 '11 at 02:48
  • @gambellhq, your best bet is to look at the included SQLite wrapper source (not the core C code, the MONO code that calls into SQLite). – Samuel Neff Feb 27 '11 at 03:18
  • @Samuel, OK, will do that. Thanks! – gambellhq Feb 27 '11 at 03:50
  • do i need to write wrapper function in c# for this c code ? – chetanya gehlot May 25 '16 at 09:19