Re: [Mono-list] Mono and sqllite on OS X

2005-01-21 Thread Thomas Zoechling
I suppose the problem here is that libsqlite is not a native mono library.
Mono.Data.Sqlite... is just a wrapper around libsqlite.so , which has to 
remain in /usr/lib.

Niklas Saers wrote:
Hi all,
I'm using fink on OS X 10.3.7 which keeps all its files in /sw 
(instead of /usr/local). When I try using any Mono application that 
uses sqlite, I get:

Unhandled Exception: System.DllNotFoundException: sqlite
in <0x000e0> (wrapper managed-to-native) 
Mono.Data.SqliteClient.SqliteConnection:sqlite_open (string,int,string&)
in [0x00031] (at 
/cvs/1-mono/mcs/class/Mono.Data.SqliteClient/Mono.Data.SqliteClient/SqliteConnection.cs:157) 
Mono.Data.SqliteClient.SqliteConnection:Open ()

/sw/lib contains:
-rwxr-xr-x  1 root  admin  450056 20 Jan 23:50 
/sw/lib/libsqlite.0.5.3.dylib
lrwxr-xr-x  1 root  admin  21 21 Jan 12:45 
/sw/lib/libsqlite.0.dylib -> libsqlite.0.5.3.dylib
-rw-r--r--  1 root  admin  685488 20 Jan 23:50 /sw/lib/libsqlite.a
lrwxr-xr-x  1 root  admin  21 21 Jan 12:45 /sw/lib/libsqlite.dylib 
-> libsqlite.0.5.3.dylib
-rwxr-xr-x  1 root  admin 725 20 Jan 23:50 /sw/lib/libsqlite.la

The remaining mono-files are at:
/sw/lib/mono/1.0/Mono.Data.SqliteClient.dll
/sw/lib/mono/gac/Mono.Data.SqliteClient
/sw/lib/mono/gac/Mono.Data.SqliteClient/1.0.5000.0__0738eb9f132ed756
/sw/lib/mono/gac/Mono.Data.SqliteClient/1.0.5000.0__0738eb9f132ed756/Mono.Data.SqliteClient.dll 

/sw/lib/mono/gac/Mono.Data.SqliteClient/1.0.5000.0__0738eb9f132ed756/Mono.Data.SqliteClient.dll.mdb 

So all looks nice, but still this problem persists. Is there any way I 
can set the path that Mono is to look for its libraries?

Cheers
   Nik
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list

___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


[Mono-list] SqliteDataAdapter and SqliteParameterCollection

2005-01-24 Thread Thomas Zoechling
Why is GetEnumerator() not implemented?
http://svn.myrealbox.com/source/trunk/mcs/class/Mono.Data.SqliteClient/Mono.Data.SqliteClient/SqliteParameterCollection.cs
Wouldnt it simply be:
public IEnumerator GetEnumerator ()
{
this.RecreateNamedHash ();
return named_param_hash.GetEnumerator();
}
Or am i totally wrong here?
If someone could point me in the right direction i would try to 
implement it.
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


[Mono-list] Per-Application dll mapping

2005-01-30 Thread Thomas Zoechling
I have a small Application that uses sqlite. Can i configure the exe 
that it uses a local copy of sqlite-3.x.x.so, with an app.config file?
Because i want to keep the installation easy and dont want the user to 
have sqlite-devel installed.

What i tried already in the config file:

 

^^sqlite-3.0.8.so is in the same dir as the application

___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Per-Application dll mapping

2005-01-30 Thread Thomas Zoechling
Paolo Molaro wrote:
On 01/30/05 Thomas Zoechling wrote:
 

I have a small Application that uses sqlite. Can i configure the exe 
that it uses a local copy of sqlite-3.x.x.so, with an app.config file?
Because i want to keep the installation easy and dont want the user to 
have sqlite-devel installed.

What i tried already in the config file:



   

Are you using sqlite directly (using DllImport in you assembly)
or are you using the Mono.Data.SqliteClient.dll assembly?
In the first case it should work, if it doesn't set the
env vars:
MONO_LOG_LEVEL="debug" MONO_LOG_MASK="dll"
and check the output.
In the second case, until we provide a config with the assembly,
you can use the same config file as the global config, by
running mono with:
mono --config sqlite.config yourapp.exe ...
lupus
 

I am using
Mono.Data.SqliteClient.dll
But i am using the svn code, compiled to a dll on a mono 1.0.5 system
I compiled the whole Mono.Data.Sqlite directory to a single dll which seems to work.
Then i compiled my app with mcs myapp -r:System.Data, Sqlite.dll which also seems to work.
But i get an dll not found exception if the sqlite devel packages are not installed.
So i tried to map the .so file with the config above and called my app with mono -config:myapp.config 
without luck:(

___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


[Mono-list] vhost setup and mod_mono [EMAIL PROTECTED]

2005-02-25 Thread Thomas Zoechling
As discussed earlier there seems to be a problem with vhosts and 
mod_mono 1.0.6:
http://lists.ximian.com/archives/public/mono-list/2005-February/025900.html

I ran into the same trouble after switching from 1.0.5 to 1.0.6 because 
mod_mono ignores all Mono* directives in the vhost configuration.

In the post above Joe Audette describes a solution where he uses
MonoApplicationsConfigDir to configure mono apps per vhost,
but I initially used this guide: 
http://www.gotmono.net/documentation/mod-mono-howto.html  , I
also need to configure  MonoUnixSocket and MonoWapiDir .
How could this be done without using Mono* directives inside 
 ?

thomas
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Mono.Data.SQLiteClient

2005-05-12 Thread Thomas Zoechling
Hi Michael!
Currently Mono.Data.SqliteClient doesnt support parameters. Therefore it 
is not usable in the "ado.net" way (DataAdapter,...)
BUT:
Currently there are 2 patches in bugzilla that implement parameter 
functionality:
http://bugzilla.ximian.com/show_bug.cgi?id=62613
http://bugzilla.ximian.com/show_bug.cgi?id=72076

The first one if form Chris Turchin and implements Parameters with 
Regular Expressions.
The second patch is from Jeroen Zwartepoorte and uses native sqlite3_bind.

As Mono supports both sqlite versions I contacted the authors of the 
original patches and tried to merge them into one. (Chris approach for 
sqlite2 and Jeroens part for sqlite3)
Currently Chris and I try to pass some unit tests, that Chris provided.
I hope I can attach a patch for review soon.

--Thomas
Michael Thomsen wrote:
I have been looking for a way to do ADO.NET with SQLite and was
wondering what the state of Mono's SQLite support is. The ADO.NET
provider that is hosted at sourceforge for SQLite seems to be really
buggy. Is it possible to use the Mono SQLite support without Mono?
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list
 


___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Using SQLite, Mono and Monodevelop

2005-06-22 Thread Thomas Zoechling

Alessandro Bottoni wrote:


I have a few questions:
-  Why I have just Windows DLLs in my /usr/lib/mono/gac/Mono.Data.SqliteClient 
directory? Shouldn't I have a few .SO Linux libraries as well?


That are CIL dlls. Therefore the term "Windows" dll isnt valid anymore 
(thats what mono is all about :) )


- Do I have to install the .SO Linux libraries by hand? Which version? I'm 
unable to identify the version of SQLite used to create the existing DLL.


To install sqlite under debian you should apt-cache search for sqlite. I 
suppose the package name will be something like libsqlite-dev.
Another way to install sqlite is to download the .so from 
http://www.sqlite.org/download.html (Scroll down the list and pick the 
.so.bz file  -
Don't take the first file -> thats some command line tool -> that way my 
first mistake :) ).
Then extract the file and symlink it to libsqlite.so or libsqlite3.so 
(depending on what version you choose).
If you still have troubles with Mono.Data.Sqlite then read the following 
Blog post of Chris Turchin:

http://turchin.homelinux.net/blogx/PermaLink.aspx/acbc7138-08d6-4a0f-a86d-709748a283d8

- Where is the test suite mentioned by the SQLite docu at 
www.go-mono.com/sqlite.html? It should be in 
mcs/class/Mono.Data.SqliteTest/Test but I'm unable to find this directory on 
my machine.


I am one of the authors of the latest Mono.Data.Sqlite patch. And I also 
provided a Test and  a UnitTest program, but I just noticed that it has 
been removed from the

patch :) Here are the basic code parts :

Notice that the Parameter delimeter in sqlite3 is ':' and that you have 
to specify the correct version in your Connection string


//
// SqliteTest.cs
//
// Author(s): Daniel Morgan <[EMAIL PROTECTED]>
// Chris Turchin <[EMAIL PROTECTED]>
// Thomas Zoechling <[EMAIL PROTECTED]>
//

using System;
using System.Data;
using System.Data.Common;
using System.IO;
using Mono.Data.SqliteClient;

namespace Test.Mono.Data.SqliteClient
{
   class SqliteTest
   {
   //static string connectionString = 
"Version=3,URI=file:SqliteTest.db";

   static string connectionString = "Version=3,URI=file:SqliteTest.db";
   static SqliteConnection dbcon = new SqliteConnection();
   static SqliteCommand dbcmd = new SqliteCommand();

   [STAThread]
   static void Main(string[] args)
   {
   Console.WriteLine("setting ConnectionString using: " + 
connectionString);

   dbcon.ConnectionString = connectionString;
  
   if (File.Exists("SqliteTest.db"))

   File.Delete("SqliteTest.db");
  
   Console.WriteLine("open the connection...");

   dbcon.Open();
   dbcmd.Connection = dbcon;
   SetupDB();
  
   Console.WriteLine("SELECTING DATA FROM MONO_TEST");
  
   TestWithoutParameters();

   TestSingleParameter();
   TestMultipleParameters();
   TestUsingDataAdapter();
   TestUpdateWithParamsAndEvents();
  
   dbcmd.Dispose();

   dbcon.Close();
  
   Console.WriteLine("Done.");

   }

   static void SetupDB()
   {
   dbcmd.CommandText = "CREATE TABLE MONO_TEST ( NID INT, NDESC 
TEXT, EMAIL TEXT)";
   Console.WriteLine("execute SqliteCommand to CREATE TABLE 
MONO_TEST: " + dbcmd.CommandText );

   dbcmd.ExecuteNonQuery();
  
   Console.WriteLine("inserting data into MONO_TEST...");
   dbcmd.CommandText = "INSERT INTO MONO_TEST  (NID, NDESC, 
EMAIL ) VALUES(1,'Mono 1','[EMAIL PROTECTED]')";

   dbcmd.ExecuteNonQuery();
  
   dbcmd.CommandText ="INSERT INTO MONO_TEST  (NID, NDESC, 
EMAIL ) VALUES(2,'Mono 2','[EMAIL PROTECTED]')";

   dbcmd.ExecuteNonQuery();
  
   dbcmd.CommandText = "INSERT INTO MONO_TEST  (NID, NDESC ) 
VALUES(3,'Mono 3')";

   dbcmd.ExecuteNonQuery();
  
   dbcmd.CommandText ="INSERT INTO MONO_TEST (NID, NDESC ) 
VALUES(4,'Mono 4')";

   dbcmd.ExecuteNonQuery();
  
   dbcmd.CommandText = "INSERT INTO MONO_TEST (NID, NDESC, 
EMAIL ) VALUES(5,'Mono 5','[EMAIL PROTECTED]')";

   dbcmd.ExecuteNonQuery();
   }

   static void TestUsingDataAdapter()
   {
   Console.WriteLine("read and display data using DataAdapter...");
   SqliteDataAdapter adapter = new 
SqliteDataAdapter("SELECT * FROM MONO_TEST", connectionString);

   DataSet dataset = new DataSet();
   adapter.Fill(dataset);

   

Re: [Mono-list] mod_mono install question

2005-06-23 Thread Thomas Zoechling

For Suse there should be a version here:
http://www.go-mono.com/download/suse-92-i586/

If you want to manual compile
Download the sources here:
http://go-mono.com/sources/

If you want really "fresh" sources get them from
SVN:(==subversion > cvs)
svn co svn://mono.myrealbox.com/source/trunk/mod_mono
svn co svn://mono.myrealbox.com/source/trunk/xsp

Configuration(Assumes that you have mod_mono tars):
http://primates.ximian.com/~gonzalo/mono/blog/files/mod_mono.html

Mark Galbreath wrote:

I've been developing ASP.NET apps in C# using M$ Visual Studio 2003 
for some time now, but am just getting started using Mono 1.1.8.1 on 
SuSE Pro 9.2 and Red Hat Enterprise AS 4.0 with Apache httpd 2.0.54.  
The Mono source was no prob to d/l, compile and install, but the Mono 
Apache module is a mystery to me.  The link on Apache takes me to a 
CVS branch, but I can find nothing to download (granted, I'm also a 
CVS newbie).
 
A clue would be appreciated.
 
thx,

~mark






This email and any file transmitted with it may be confidential and is 
intended solely for the use of the individual or entity to whom it is 
addressed. If you received this email in error please notify the DBM 
Service Desk by forwarding this message to [EMAIL PROTECTED]



This email has been scanned by networkMaryland Antivirus Service for 
the presence of computer viruses.




___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list
 



___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Sqlite version

2005-08-04 Thread Thomas Zoechling

You have to specify the Version in the Connectionstring:

   string connectionString = "Version=3,URI=file:SqliteTest.db";



Julien Sobrier wrote:


Chris Turchin a écrit :


It works with 2.8.16 and 3.1.3 at any rate. I have tested both.

Regards,

--chris



With what version of Mono? I've tried Sqlite 3.0.8 and 
Mono.Data.SqliteClient doesn't recognize the database format.


Thank you
Julien

___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list




___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Re: Can I control the number of XSP processes?

2005-08-14 Thread Thomas Zoechling



If anybody thinks the code would be useful, I'm happy to share it, though I may 
have to strip out portions for security reasons. (I'd replace with appropriate 
comments, of course)



Sounds interesting. It would be cool if you can post the script.

   Thomas
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Sqlite version

2005-08-26 Thread Thomas Zoechling

http://turchin.homelinux.net/blogx/PermaLink.aspx/acbc7138-08d6-4a0f-a86d-709748a283d8

Julien Sobrier wrote:


Thomas Zoechling a écrit :


You have to specify the Version in the Connectionstring:

   string connectionString = "Version=3,URI=file:SqliteTest.db";



Hello,
it doesn't seem to work with mono 1.1.6:
System.DllNotFoundException: sqlite3
in (wrapper managed-to-native)
Mono.Data.SqliteClient.Sqlite:sqlite3_open (string,intptr&)
in <0x00056> Mono.Data.SqliteClient.SqliteConnection:Open ()
in <0x00066> Platine.Plugins.FetchCDInfo:Initialize
(Platine.CoreLibs.Session session)
in <0x00130> Platine.Plugins.FetchCDInfo:Main (System.String[] args)

It looks like it doesn't handle sqlite version 3. I couldn't find
anything useful on Internet about this error message.

Julien Sobrier







___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list




___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] mod_mono and SQLite

2006-02-03 Thread Thomas Zoechling

http://www.mono-project.com/Interop_with_Native_Libraries#Linux_Shared_Library_Search_Path

^^ This is how the runtime searches for the library.

You need the shared object for linux (.so):
http://www.sqlite.org/sqlite-3.3.3.so.gz

You can unpack it in your app directory (I suppose that would be the
/bin folder for web apps)
or create a /usr/lib/libsqlite3.so symlink to the shared object.

--thomas

Jonel Rienton schrieb:

it's in Mono's website, SQLite3.dll has to be in your PATH or in the
current directory

  

 Original Message 
Subject: Re: [Mono-list] mod_mono and SQLite
From: Duncan McQueen <[EMAIL PROTECTED]>
Date: Fri, February 03, 2006 6:06 am
To: Mono-list@lists.ximian.com

I noticed the same thing and did have SQlite3.dll in the /bin
directory.  SQLite3.dll is an assembly - and I think you need to have
it in your system path somewhere but not your assembly directory.

On 2/3/06, Everaldo Canuto <[EMAIL PROTECTED]> wrote:


Hi,

Please type a:

`ls -l /home/sfbell/forums/bin/*'

and send us the result.

Everaldo.


Em Qui, 2006-02-02 às 23:26 -0500, Steven Bell escreveu:
  

`/home/sfbell/forums/bin/


___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list

  

___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list



___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


  



___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Bug in Mono.Data.SqliteClient?

2007-01-04 Thread Thomas Zoechling

I tried your query and it seems to work for me.

From Mono.Data.SqliteClient/SqliteCommand.cs:

   public SqliteDataReader ExecuteReader ()
   {
   return ExecuteReader (CommandBehavior.Default);
   }
  
   public SqliteDataReader ExecuteReader (CommandBehavior behavior)

   {
   int r;
   return ExecuteReader (behavior, true, out r);
   }
  
   public SqliteDataReader ExecuteReader (CommandBehavior behavior, 
bool want_results, out int rows_affected)

   {
   Prepare ();
  
   // The SQL string may contain multiple sql commands, so the 
main

   // thing to do is have Sqlite iterate through the commands.
   // If want_results, only the last command is returned as a
   // DataReader.  Otherwise, no command is returned as a
   // DataReader.


As you can see, the default behavior supports multiple commands.
I attached a simple test case, that contains your query.
On Mac OS 10.4.8,  mono 1.2.2.1 intel 32bit and the latest sqlite 
version my test case works as expected.
Both commands get executed, and ExecuteReader() returns a DataReader 
containing the results.


--Thomas

Chris Seaton wrote:

Does anyone have experience using Mono.Data.SqliteClient?

It works fine for me apart from when I have multiple Sql statements  
in a single command. If I run something like


command = database.CreateCommand();
command.CommandText = "update films set year = year + 10; select  
year, title from films where year >= 1980;";

reader = command.ExecuteReader();

I expect both statements to be executed and to read results from the  
second statement. This is what the source code seems to imply is what  
should happen. When I try it, only the first statement is executed.


Any ideas?

Thanks

Chris Seaton
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list

  


using System;
using System.Data;
using System.IO;
using System.Text;
using Mono.Data.SqliteClient;

namespace MonoTests.Mono.Data.SqliteClient
{
	public class SqliteCommandUnitTests
	{
		readonly static string uri = "SqliteTest.db";
		readonly static string connectionString = "URI=file://" + uri + ", version=3";
		static SqliteConnection conn = new SqliteConnection (connectionString);

		[STAThread]
		static void Main(string[] args)
		{
			Create();
			InsertWithTransaction();
			Select();
		}

		public static void Create()
		{
			try
			{
if(File.Exists(uri))
{
	conn.Dispose();
	File.Delete(uri);
}
			}
			catch(Exception e)
			{
throw e;
			}
			
			SqliteCommand createCommand = new SqliteCommand("CREATE TABLE FILMS(TITLE TEXT, YEAR INTEGER)",conn);
			SqliteCommand insertCommand = new SqliteCommand("INSERT INTO FILMS (TITLE, YEAR) VALUES('A Clockwork Orange', 1971)",conn);

			try
			{
conn.Open();
createCommand.ExecuteNonQuery();
insertCommand.ExecuteNonQuery();
			}
			catch(Exception e)
			{
throw new Exception("Sqlite CREATE failed",e);
			}
			finally
			{
conn.Close();  
			}
		}

		public static void Select()
		{
			SqliteCommand simpleSelect = new SqliteCommand("UPDATE FILMS SET YEAR = YEAR + 10; SELECT YEAR, TITLE FROM FILMS WHERE YEAR >= 1980;", conn);
			using(conn)
			{
conn.Open();
SqliteDataReader dr = simpleSelect.ExecuteReader();
while(dr.Read())
{
	string test = dr[0].ToString();
	Console.WriteLine(test);
}
			}
		}

		
		public static void InsertWithTransaction()
		{
			conn.Open();
			SqliteTransaction t = conn.BeginTransaction() as SqliteTransaction;
			SqliteCommand  c1 = new SqliteCommand("INSERT INTO FILMS VALUES ('The Departed',2006)",conn,t);
			SqliteCommand  c2 = new SqliteCommand("INSERT INTO FILMS VALUES ('City of God',2002)",conn,t);
			SqliteCommand  c3 = new SqliteCommand("INSERT INTO FILMS VALUES ('The usual Suspects',1995)",conn,t);
			SqliteCommand  c4 = new SqliteCommand("INSERT INTO FILMS VALUES ('Rear Window',1954)",conn,t);
			using(conn)
			{
try
{
	c1.ExecuteNonQuery();
	c2.ExecuteNonQuery();
	c3.ExecuteNonQuery();
	c4.ExecuteNonQuery();
	t.Commit();
}
catch(Exception e)
{
	t.Rollback();
	throw new Exception("Sqlite INSERT (with transaction) failed", e);
}
			}
		}
	}
}___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list