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] 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] 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] 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] 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);

   DisplayDataSet(dataset);
  
   Console.WriteLine(next test...);

   Console.WriteLine(Insert and change data using dataset...);
   DataRow dataRow = dataset.Tables[0].NewRow();
   dataRow[NID] = 6;
   dataRow[NDESC] = New via dataset;
   dataRow[EMAIL] = [EMAIL PROTECTED];
   dataset.Tables[0].Rows.Add(dataRow

[Mono-devel-list] [PATCH]Mono.Data.SqliteClient - Parameter Support

2005-05-23 Thread Thomas Zoechling

http://bugzilla.ximian.com/show_bug.cgi?id=62613

I merged the patches provided by Chris Turchin and Jeroen Zwartepoorte.

   - Parameter support for sqlite2 (regular expression to extract the 
Paramter)

   - Parameter support for sqlite3 (native via sqlite3_bind)
   - Nunit Tests
   - Enables DataAdapter for Sqlite
Index: Mono.Data.SqliteClient/SqliteParameterCollection.cs
===
--- Mono.Data.SqliteClient/SqliteParameterCollection.cs (revision 44904)
+++ Mono.Data.SqliteClient/SqliteParameterCollection.cs (working copy)
@@ -4,8 +4,11 @@
 // Represents a collection of parameters relevant to a SqliteCommand as well 
as 
 // their respective mappings to columns in a DataSet.
 //
-// Author(s): Vladimir Vukicevic  [EMAIL PROTECTED]
-//Everaldo Canuto  [EMAIL PROTECTED]
+//Author(s):   Vladimir Vukicevic  [EMAIL PROTECTED]
+// Everaldo Canuto  [EMAIL PROTECTED]
+// Chris Turchin [EMAIL PROTECTED]
+// Jeroen Zwartepoorte [EMAIL PROTECTED]
+// Thomas Zoechling [EMAIL PROTECTED]
 //
 // Copyright (C) 2002  Vladimir Vukicevic
 //
@@ -46,85 +49,148 @@
#endregion
 
#region Private Methods
-   
+
private void CheckSqliteParam (object value)
{
if (!(value is SqliteParameter))
-   throw new InvalidCastException(Can only use 
SqliteParameter objects);
-   }
+   throw new InvalidCastException (Can only use 
SqliteParameter objects);
+   SqliteParameter sqlp = value as SqliteParameter;
+   if (sqlp.ParameterName == null || 
sqlp.ParameterName.Length == 0)
+   sqlp.ParameterName = 
this.GenerateParameterName();
+ }
 
private void RecreateNamedHash ()
{
-   for (int i = 0; i  numeric_param_list.Count; i++) {
+   for (int i = 0; i  numeric_param_list.Count; i++) 
+   {
named_param_hash[((SqliteParameter) 
numeric_param_list[i]).ParameterName] = i;
}
}
-   
+
+   //FIXME: if the user is calling Insert at various locations 
with unnamed parameters, this is not going to work
+   private string GenerateParameterName()
+   {
+   int index   = this.Count + 1;
+   string  name= String.Empty;
+
+   while (index  0)
+   {
+   name = : + index.ToString();
+   if (this.IndexOf(name) == -1)
+   index = -1;
+   else
+   index++;
+   }
+   return name;
+   }
+
#endregion
 
#region Properties

object IList.this[int index] {
-   get {
+   get 
+   {
return this[index];
}
-   set {
+   set 
+   {
CheckSqliteParam (value);
this[index] = (SqliteParameter) value;
}
}

object IDataParameterCollection.this[string parameterName] {
-   get {
+   get 
+   {
return this[parameterName];
}
-   set {
+   set 
+   {
CheckSqliteParam (value);
this[parameterName] = (SqliteParameter) value;
}
}

-   public SqliteParameter this[string parameterName] {
-   get {
-   return this[(int) 
named_param_hash[parameterName]];
+   public SqliteParameter this[string parameterName] 
+   {
+   get 
+   {
+   if (this.Contains(parameterName))
+   return this[(int) 
named_param_hash[parameterName]];
+   else
+   throw new IndexOutOfRangeException(The 
specified name does not exist:  + parameterName);
}
-   set {
-   if (this.Contains (parameterName))
+   set

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


[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:
configuration
 dllmap dll=sqlite target=sqlite-3.0.8.so /
/configuration
^^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:
configuration
dllmap dll=sqlite target=sqlite-3.0.8.so /
/configuration
   

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] 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


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