I have had a much better time using Mono.Data.SqliteClient than the SystemData method. I'm not saying anything negative about the System.Data method only that the Mono.Data method just seemed to work better for me.

Have you tried the Mono version yet? You may like it better for cross platform usage.
Spoody Goon

On 1/18/2010 2:46 PM, Dan Winslow wrote:

I am trying to write a single source that can run on both windows and linux, and that uses Sqlite as its data storage. I am using the current mono build ( I built from latest tarball ). Linux is EL5 ( CentOS ). I started off getting it to work in VS Studio on windows :

   1. I downloaded and installed the System.Data.SQLite ado provider
      from phxsoftware.
   2. I wrote a simple test in VS studio 2008 ( writing to a
      samba-mount on the linux box ):

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

namespace test

{

class Program

  {

static void Main(string[] args)

    {

System.Data.SQLite.SQLiteConnection dbh=new System.Data.SQLite.SQLiteConnection();

      dbh.ConnectionString = "Data Source=test.db; Version=3;";

      dbh.Open();

    }

  }

}

   3. I added in a reference to the System.Data.SQLite.DLL ( not the
      managed-only version )
   4. Built in VS, then ran. Worked.
   5. Went to the linux box, ran mono bin/Debug/test.exe, and got :

Unhandled Exception: System.DllNotFoundException: System.Data.SQLite.DLL

at (wrapper managed-to-native) System.Data.SQLite.UnsafeNativeMethods:sqlite3_open_interop (byte[],int,intptr&)

at System.Data.SQLite.SQLite3.Open (System.String strFilename, SQLiteOpenFlagsEnum flags, Int32 maxPoolSize, Boolean usePool) [0x00000] in <filename unknown>:0

at System.Data.SQLite.SQLiteConnection.Open () [0x00000] in <filename unknown>:0

at test.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0

   6. did a gacutl --i System.Data.SQLite.DLL. Ran, same result as in 5.
   7. did an xbuild of test.sln, it (worked) and also said :

Copying file from '/aim/eventus_agent/Sqlite.Net.Binaries/System.Data.SQLite.DLL' to '/aim/eventus_agent/test/bin/Debug/System.Data.SQLite.DLL'

   8. looked in bin/Debug, saw that I now had a System.Data.SQLite.dll
      as well as a System.Data.SQLite.DLL. Ok, taking care of
      case-sensitivity issues I suppose.
   9. Ran as in 5, same result.
  10.  Went back to VS, removed the ref, and added the 'Managed Only'
      version. Ran, worked.
  11. Went back to linux, did an xbuild, ran, and got :

Unhandled Exception: System.EntryPointNotFoundException: sqlite3_open_v2

at (wrapper managed-to-native) System.Data.SQLite.UnsafeNativeMethods:sqlite3_open_v2 (byte[],intptr&,int,intptr)

at System.Data.SQLite.SQLite3.Open (System.String strFilename, SQLiteOpenFlagsEnum flags, Int32 maxPoolSize, Boolean usePool) [0x00000] in <filename unknown>:0

at System.Data.SQLite.SQLiteConnection.Open () [0x00000] in <filename unknown>:0

at test.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0

  12. This looked to me like it was having trouble locating the .so
      file, so I downloaded the latest .so from sqlite.org, and placed
      it in the build directory as libsqlite3.so.
  13. ran, got same result as in 11. Messed around with MONO_PATH and
      LD_LIBRARY_PATH...did not help.

I am currently out of ideas..I would really like to be able to use the same source on windows and linux, as that's kind of the idea of Mono to my mind. I know I could probably use the Mono sqlite package on linux, but I'd have to have separate builds as far as I know.

Dan Winslow
Director of Information Technology, AIM INSTITUTE
1905 Harney Street, Suite 700
Omaha, NE 68102
402-345-5025 x156
[email protected] <mailto:[email protected]>
www.aiminstitute.org <http://www.aiminstitute.org>


_______________________________________________
Mono-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-list

_______________________________________________
Mono-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-list

Reply via email to