INTEGER with DEFAULT NULL throws exception

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for SQLite
Post Reply
derhexer
Posts: 2
Joined: Sun 17 Feb 2013 18:35

INTEGER with DEFAULT NULL throws exception

Post by derhexer » Sun 17 Feb 2013 18:45

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?

derhexer
Posts: 2
Joined: Sun 17 Feb 2013 18:35

Re: INTEGER with DEFAULT NULL throws exception

Post by derhexer » Mon 18 Feb 2013 07:49

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' ...

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: INTEGER with DEFAULT NULL throws exception

Post by Pinturiccio » Mon 18 Feb 2013 15:59

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

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: INTEGER with DEFAULT NULL throws exception

Post by Pinturiccio » Mon 25 Feb 2013 14:35

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.

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: INTEGER with DEFAULT NULL throws exception

Post by Pinturiccio » Fri 01 Mar 2013 11:05

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

Post Reply