in

System.Data.SQLite

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

Whats with all the errors?

Last post 04-11-2008 9:35 AM by whuili_2004. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 12-08-2007 1:52 PM

    Whats with all the errors?

    I am about to give up on this, every time I try to do a simple task I always get a major error.  Plus there are like zero examples out there on how to use these databases.

    First I try to create a simple db, I get an error about the dll file not being a valid .net file.  This is the same .dll file that is packaged on the website in the source code.  If you look at the file in windows explorer, it will show a filesize of 131k, well this file is not a valid .net file.

    In order to get the code to create a db file, I had to recompile the System.Data.SQLite FULL project file, then the .dll file was recognized and I could create a new db.

    Seems there are more problems after that.  After you create the db file and you try to open it "dbfile.Open()", you get an error stating that this is not a valid call.  EntryPointNotFoundException: Unable to find an entry point named 'sqlite3_open_interop' in DLL 'System.Data.SQLite.DLL'.  I searched the web and came back with this result from the error.

    //-------------------------------------
    You shouldn't include the SQLite project files with your project.  The SQLite project has several dependencies and custom build steps that you are missing.  The reason you're getting this error is because the System.Data.SQLite-Full project is an "intermediate project" which builds ONLY the wrapper.  The "SQLite.Interop" project is responsible for compiling the native engine and merges it with the wrapper in a custom build step.

    By referencing only the SQLite project, you're only getting the wrapper and the native engine isn't being merged with the assembly.
    //-------------------------------------

    Now for someone who has never used sqlite before, and is just learning c#, this is very frustrating.

    Can anyone recommend a flat file db that has lots of examples and pretty much works?  I just want to write a simple db program that will run on my desktop, and it will run on my pocket pc too.  Thats all, I am not trying to write hundreds of tables with multi threading or anything like that.

     

    TIA

     

    Justin
  • 12-08-2007 3:31 PM In reply to

    Re: Whats with all the errors?

    Why are you building the sources from scratch when I've already built them for you?

    The System.Data.SQLite project is a mixed-mode DLL and has different processor versions. One for x64, one for x86, for Itanium and a Compact Framework ARM version. It's not a 100% managed library and is not completely portable across all platforms and environments. You'll have to be careful how you build your project if you want it to run on the Compact Framework and on the desktop without recompiling.

    Now ... if you intend to make a GUI application that runs on the CF and on the desktop, your options will be restricted. Lots of GUI elements don't exist on the CF that exist on the full desktop .NET framework. Your best bet is to write a CompactFramework project referencing the DLL in the bin\CompactFramework folder (which you get when you run the SQLite-1.0.47.1-setup.exe program). When you redistribute it on the desktop, you'll have to copy over the desktop version of the System.Data.SQLite.DLL -- and when you distribute it on the Compact Framework, copy over the CompactFramework version of the DLL.

    All you really need to do is run the setup.exe program available from SourceForge, and add a reference to System.Data.SQLite to your project. There's no need to download the source or fiddle with the build complexities involved -- which are rather complicated. Robert

  • 12-08-2007 3:35 PM In reply to

    Re: Whats with all the errors?

    Okay, now I am getting somewhere.  I will have to download the install file instead of the source.  I was under the impression that I had to download the source code.  One file was an install file and the other just zipped up.  Now I know.

     

    Thanks

     

    Justin
  • 04-10-2008 5:40 PM In reply to

    Re: Whats with all the errors?

    Hi,

     I get the same error as: "Unable to find an entry point named 'sqlite3_open_interop' in DLL 'System.Data.SQLite.DLL'". I found the following answer. However, what should I do for that? I try to unload this "System.Data.SQLite - Full" and I get the same error. Thanks.

    //-------------------------------------
    You shouldn't include the SQLite project files with your project.  The SQLite project has several dependencies and custom build steps that you are missing.  The reason you're getting this error is because the System.Data.SQLite-Full project is an "intermediate project" which builds ONLY the wrapper.  The "SQLite.Interop" project is responsible for compiling the native engine and merges it with the wrapper in a custom build step.

    By referencing only the SQLite project, you're only getting the wrapper and the native engine isn't being merged with the assembly.
    //-------------------------------------

  • 04-10-2008 7:27 PM In reply to

    Re: Whats with all the errors?

    Basically what I did was follow Roberts suggestions.  When I downloaded the source I didn't realize what I was doing.  But when he said I was supposed to be using the dll files that he also provides on the site, that was the answer.  I just downloaded the dll file and that was it.

    If you want to build the source and do whatever with it, you really got me on that one.

     

    Justin
  • 04-11-2008 8:40 AM In reply to

    Re: Whats with all the errors?

    Hi Justin,

     Thanks a lot for your answer.

    On the following website,there are 3 options :

    SQLite-1.0.48.0-binaries.zip  Mirror

    SQLite-1.0.48.0-setup.exe  Mirror

    SQLite-1.0.48.0-source.zip  Mirror

    http://sourceforge.net/project/showfiles.php?group_id=132486&package_id=145568&release_id=564661

    I downloded the SQLite-1.0.48.0-setup.exe. Is it right? After I run this .exe file, I get the followings:

    bin folder, Doc folder and readme.html file.

    System.Data.SQLite.DLL is in the bin folder.

    If this installing is right, what else should I do?

    Thanks again.

     

  • 04-11-2008 9:35 AM In reply to

    Re: Whats with all the errors?

    Hi Justin,

     I get it, and thanks a lot.

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