in

System.Data.SQLite

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

Compilation of sqlite3.dll

Last post 11-09-2009 2:15 PM by malloth. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 11-08-2009 3:35 AM

    • malloth
    • Top 500 Contributor
    • Joined on 11-07-2009
    • Poland
    • Posts 5

    Compilation of sqlite3.dll

    Hello, it's my first post but I've been following this community for some time now.
    I really like SQLite and it's C# wrapper, but I recently realized that the phxsoftware's wrapper isn't flexible enough for my needs.
    Therefore I'd like to ask Robet few things:

    1) Could You please change Your current tactics on wrapper/native layout?
    I mean: System.Data.SQLite should be a stable, non version dependent wrapper hich uses sqlite3.dll, and sqlite3.dll should be just a native compilation which we can make from amalgation available at sqlite.org site. With such an approach I could easily change only the sqlite3.dll to the newest available without the need of changing both - wrapper and second lib and recompiling my project each time Your new version appears.

    We would be less dependent on Your time.

    2) How to compile the SQLite amalgation so that I can have an exportable functions / methods?
    I've downloaded amalgation, compiled it with C++ complier (VS2005 SP1) with usage of secchk.lib (included header and ext header files too), but even though all functions have extern "C", I can't see those after disassambling the dll I'm creating.

    What more is needed? I want to invoke those fuctions directly from C# p/invkoes.
    Please help.

    Thanks in advance.
  • 11-08-2009 9:24 AM In reply to

    Re: Compilation of sqlite3.dll

    1.  Use the ManagedOnly edition of the library.  That's exactly what it's for and that's exactly what it does.

    2.  You need to get/build/create/whatever the .DEF file and include it in your project when you build so those functions are exported.

     

  • 11-08-2009 2:46 PM In reply to

    • malloth
    • Top 500 Contributor
    • Joined on 11-07-2009
    • Poland
    • Posts 5

    Re: Compilation of sqlite3.dll

    Ah, thanks for the info :).

    I've created a brand new project and at last! - it compiled with exportable functions.
    My problem was connected with previous compilations (previously I added .def file but it showed me that C won't use it).

    Now I have two more questions for a great guy like You:

    3) Do I have to implement Windows Mobile math functions the way You did for them to work inside SQL statements?

    4) Can I copy Your encryption / decyption mechanisms? I've tried to comprehend many times Crypto API but without luck :).

    Thanks for Your time, patience and good work You're doing.

    PS. What did You throw out from Your version of sqlite3.dll? Mine has 547KB while Yours has 455KB.
  • 11-08-2009 3:34 PM In reply to

    Re: Compilation of sqlite3.dll

    If you want to use doubles on windows mobile, then yes you'll have to create your own interop functions in C because you can't pass them byvalue from .NET.

    Feel free to use whatever code you like out of the original project.  It's public domain.

    As for the size ... the one from sqlite.org is cross-compiled for Windows on a *nix machine, so I'm not sure what got included/excluded.

     

  • 11-09-2009 11:18 AM In reply to

    • malloth
    • Top 500 Contributor
    • Joined on 11-07-2009
    • Poland
    • Posts 5

    Re: Compilation of sqlite3.dll

    Thanks again for Your time Robert.

    So I don't need nothing extra for queries with math functions to work with mine sqlite3.dll and Your .NET managed-only wrapper?
    Those are build-in and You've just created these (from Your source code) math functions for interoperability, right?

    As for size - with which preprocessor directives did You compile Your interop? Maybe that's the difference...
    I've compiled my sqlite3.dll with: SQLITE_ENABLE_COLUMN_METADATA and SQLITE_ENABLE_UNLOCK_NOTIFY
  • 11-09-2009 12:18 PM In reply to

    • malloth
    • Top 500 Contributor
    • Joined on 11-07-2009
    • Poland
    • Posts 5

    Re: Compilation of sqlite3.dll

    Geez, I hate to be a pain in the ass, but I have one more problem.

    I can't compile my NETCF project with that managed-only System.Data.SQLite.
    Compiler says:

    "Error 1 The type 'System.Data.Common.DbDataReader' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. C:\Documents and Settings\Mal Loth\...
    Error 2 The type 'System.Data.Common.DbConnection' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. C:\Documents and Settings\Mal Loth\...
    Error 3 The type 'System.Data.Common.DbTransaction' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. C:\Documents and Settings\Mal Loth\...
    Error 4 The type 'System.Data.Common.DbCommand' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. C:\Documents and Settings\Mal Loth\..."

    although I'm having references for System.Data in my project.
    What the heck?! Is managed-only wrapper only compiled for full .NET?

    EDIT:

    Ok, sorry. I've used Your compact version and renamed its interop name to sqlite3.dll and created managed-only System.Data.SQLite for NET CF :).
    Thanks for Your source Robert.
  • 11-09-2009 2:15 PM In reply to

    • malloth
    • Top 500 Contributor
    • Joined on 11-07-2009
    • Poland
    • Posts 5

    Re: Compilation of sqlite3.dll

    Eh, the one I've made is not so good :/.
    When do You intend to create a new interop with SQLite 3.6.20 ?
    I really lack the ability to create foreign keys...
Page 1 of 1 (7 items)
Powered by Community Server (Commercial Edition), by Telligent Systems