in

System.Data.SQLite

An open source ADO.NET provider for the SQLite database engine

How to open a DB given a Stream rather than a Filename

Last post 04-11-2008 12:03 PM by undef. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 04-10-2008 11:03 AM

    • undef
    • Top 500 Contributor
    • Joined on 03-19-2008
    • Posts 3

    How to open a DB given a Stream rather than a Filename

    Hi,

    Up until now I have been using the standard:

    SQLiteConnection cnn = new SQLiteConnection("Data Source=" + fileName);
     

    method to open a database.

    Now i'd like to read the database from an existing C# Stream.

    Any advice on if this is possible and if so how to go about it would be much appreciated.

    Thanks in advance! 

     

  • 04-10-2008 5:35 PM In reply to

    Re: How to open a DB given a Stream rather than a Filename

    This unfortunately is impossible.  A C# stream is a .NET construct that can be memory, file, or <insert implementation here> based, and SQLite is an unmanaged database engine.  SQLite requires a file, located on a filesystem that supports locking portions of the file ... alternatively it can be used in-memory, but there's no support for any other kind of underlying store.

    Robert

     

  • 04-11-2008 12:03 PM In reply to

    • undef
    • Top 500 Contributor
    • Joined on 03-19-2008
    • Posts 3

    Re: How to open a DB given a Stream rather than a Filename

    Robert thanks, that all makes sense!

    Is it possible to read a stream containing a database into some datastructure in memory and make a connection using that?

      

Page 1 of 1 (3 items)
Powered by Community Server (Commercial Edition), by Telligent Systems