AutoIncrement problem with DataAdapter.FillSchema

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for SQLite
Post Reply
wcroteau
Posts: 1
Joined: Fri 16 Dec 2011 15:06

AutoIncrement problem with DataAdapter.FillSchema

Post by wcroteau » Fri 16 Dec 2011 15:33

There appears to be a problem with autoincrement columns when filling a DataSet schema...

I have this table:

Code: Select all

CREATE TABLE Test (ID INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, Val INTEGER);
My test code is as follows:

Code: Select all

DataSet ds = new DataSet();
SQLiteDataAdapter da = new SQLiteDataAdapter("SELECT ID, Val FROM Test", conn);
da.FillSchema(ds, SchemaType.Mapped, "Test");
da.Fill(ds, "Test");
Now when I inspect ds.Tables[0].Columns["ID"].AutoIncrement I get false.

In my mind, this isn't supposed to happen. It should be true since I expressly created the column as AUTOINCREMENT.

I know that SQLite is capable of doing autoincrement in another way but that doesn't seem to be compatible with generic DataSets.

I cannot use a typed DataSet in this case so that's not a viable option.

I'm running dotConnect for SQLite v.3.60.258.0

And by the way, I've compared this result with the results of a similar test using the provider from System.Data.SQLite and that implementation returns true as expected so this seems to be an issue with the provider and not the underlying database.

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

Post by Pinturiccio » Tue 20 Dec 2011 09:38

We have reproduced the issue. We will investigate it and notify you about the results as soon as possible.

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

Post by Pinturiccio » Thu 22 Dec 2011 13:05

The behavior when AutoIncrement property is not returned with SQLiteDataAdapter.FillSchema(DataSet, SchemaType.Mapped) is the designed behavior. SQLite allows setting assigning custom values to AutoIncrement columns, so we decided not to set Autoincrement property for the columns when using SQLiteDataAdapter.FillSchema(DataSet, SchemaType.Mapped) in order to permit modifying Autoincrement column values with DML statements.

Post Reply