[Mono-dev] Problem with sqlite in mono 1.1.13

Fredrik Nilsson jymdman at home.se
Sun Jan 22 16:20:44 EST 2006


Hi,

I'm having problem with sqlite since mono version 1.1.13.
Getting a long (Int64) value doesn't work anymore.
I didn't have any problems with this in version 1.1.12.

Small test case will follow.

/Fredrik Nilsson


using System;
using Mono.Data.SqliteClient;

class MainClass
{
    public static void Main(string[] args)
    {
        long filetime = DateTime.Now.ToFileTime ();

        Console.WriteLine ("Value to store: " + filetime);
        
        SqliteCommand cmd = new SqliteCommand();
        SqliteConnection connection = new 
SqliteConnection(@"version=3,URI=file:test.db");
        connection.Open();
        cmd.Connection = connection;
        cmd.CommandText = "CREATE TABLE Test (Date INTEGER NOT NULL);";
        cmd.ExecuteNonQuery ();

        cmd = new SqliteCommand ();
        cmd.Connection = connection;
        cmd.CommandText = "INSERT INTO Test (Date) VALUES ('" + filetime 
+ "');";
        cmd.ExecuteNonQuery ();

        cmd = new SqliteCommand ();
        cmd.Connection = connection;
        cmd.CommandText = "SELECT * FROM Test;";
        SqliteDataReader reader = cmd.ExecuteReader ();
        
        while (reader.Read ()) {
            Console.WriteLine ("Value in database: " + reader[0]);
        }
        
        connection.Close();
    }
}



More information about the Mono-devel-list mailing list