Page 1 of 1

INTEGER with DEFAULT NULL throws exception

Posted: Sun 17 Feb 2013 18:45
by derhexer
Hi,

is there a way to "learn" SQLiteCommand to understand a field definition like the following

Code: Select all

CREATE TABLE test (value INTEGER DEFAULT NULL);
I use INTEGER with DEFAULT NULL, but the following code throws an exception in cmd.ExecuteReader().

Code: Select all

SQLiteConnection database = new SQLiteConnection(@"DataSource=test.sqlite");
database.Open();

SQLiteCommand cmd = new SQLiteCommand(@"SELECT * from test", database);
DataTable table = new DataTable();
table.Load(cmd.ExecuteReader()); 
The c# code works fine if i use the INTEGER without DEFAULT NULL

Code: Select all

CREATE TABLE test (value INTEGER);
Why?

Re: INTEGER with DEFAULT NULL throws exception

Posted: Mon 18 Feb 2013 07:49
by derhexer
Now i tested the same test table (with INTEGER DEFAULT NULL) with System.Data.SQLite.
Result: Works..

So it must be a problem of my kind using 'dotConnect for SQLite' or a problem in 'dotConnect for SQLite' ...

Re: INTEGER with DEFAULT NULL throws exception

Posted: Mon 18 Feb 2013 15:59
by Pinturiccio
We have reproduced the issue. We will investigate it and notify you about the results as soon as possible.
As a temporary workaround, try using SQLiteDataAdapter for filling DataTable:

Code: Select all

SQLiteDataAdapter da = new SQLiteDataAdapter(cmd);
da.Fill(table);

Re: INTEGER with DEFAULT NULL throws exception

Posted: Mon 25 Feb 2013 14:35
by Pinturiccio
We have fixed the bug with filling DataTable from table containing columns with default NULL. We will notify you when the corresponding build of dotConnect for SQLite is available for download.

Re: INTEGER with DEFAULT NULL throws exception

Posted: Fri 01 Mar 2013 11:05
by Pinturiccio
The new build of dotConnect for SQLite 4.5.192 is available for download now!
It can be downloaded from http://www.devart.com/dotconnect/sqlite/download.html (trial version) or from Registered Users' Area (for users with valid subscription only).
For more information, please refer to http://forums.devart.com/viewtopic.php?t=26104