[Mono-dev] Problem with sqlite in mono 1.1.13

Fredrik Nilsson jymdman at home.se
Sun Jan 22 16:49:36 EST 2006


Sorry, forgot to attach output of testcase:

Value to store: 127824400782036290
Value in database: -2109895358

/Fredrik Nilsson


Fredrik Nilsson wrote:
> 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();
>    }
> }
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>




More information about the Mono-devel-list mailing list