[Mono-list] Sqlite Client

Joshua Tauberer tauberer at for.net
Tue Nov 29 10:41:28 EST 2005


It looks like this is an issue internal to Sqlite, where you can't 
create/modify tables after 'preparing' an SQL statement.  A "database 
schema has changed" error is being generated on the second CREATE TABLE, 
except another issue is preventing that from being reported.  The way 
the binding works now is that it prepares all of the statements in the 
SQL string, and then executes each of them.  Given this issue, we won't 
be able to prepare statements ahead of time (in the general case).

SqliteCommand needs to be rewritten.  Ah well.

-- 
- Joshua Tauberer

http://taubz.for.net

** Nothing Unreal Exists **



Ecmel Ercan wrote:
> I am using Mono 1.1.10_1 installer on Ubuntu 5.10.  This should be the
> latest official release.
> 
> using System;
> using System.Data;
> using Mono.Data.SqliteClient;
> 
> 
> public class TestSqlite
> {
>    public static void Main (string[] args)
>    {
>        string connString = "version=3,URI=file:test.db";
>        SqliteConnection dbcon = new SqliteConnection (connString);
>        dbcon.Open ();
> 
>        SqliteCommand dbcmd = new SqliteCommand (@"
>            CREATE TABLE counter1 (
>                transid INTEGER
>            );
> 
>            CREATE TABLE counter2 (
>                transid INTEGER
>            );
> 
>        ");
> 
>        dbcmd.Connection = dbcon;
>        dbcmd.ExecuteNonQuery ();
> 
>         dbcmd.Dispose ();
>         dbcon.Close ();
>    }
> }
> 
> 
> This creates only counter1.



More information about the Mono-list mailing list