InsertCommand on autoincrement indexed tables

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for SQLite
Post Reply
cluster
Posts: 1
Joined: Tue 05 Apr 2011 14:00

InsertCommand on autoincrement indexed tables

Post by cluster » Tue 05 Apr 2011 14:10

Hi,

I'm using the pro version of dotConnet Universal which I just purchased yesturday.
I'm trying to bind the new SQLite adapter to my project, unfotunatly with some issues.
I'm using Devart.Data.Universal.SQLite.dll version 3.20.44.0

the problem:

while using th myAdapter.InsertCommand() on a DataTable I usually set a NULL value for the index which is an autoincremental int.
I used that witch other adapters befor however this leads to a problem using the SQLite provider from DevArt.

Can you please help me finding a quik solution
thank and best regards from Germany,
cluster

StanislavK
Devart Team
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Post by StanislavK » Fri 08 Apr 2011 17:05

Could you please specify the problem you've encountered (e.g., the message and stack trace of the exception) and the exact way you are updating the table? For example, the following code worked well in our environment:

Code: Select all

UniDataAdapter adapter = new UniDataAdapter("select id, val from test", connection);
adapter.InsertCommand = new UniCommand("insert into test values (null, :val)", connection);
adapter.InsertCommand.Parameters.Add("val", UniDbType.VarChar, 10, "val");

DataTable dt = new DataTable();
adapter.Fill(dt);

dt.Rows.Add(0, "C");
adapter.Update(dt);
Please specify what should be changed in this sample to reproduce the issue.

The table used in the sample is defined as

Code: Select all

create table test (
  id INTEGER PRIMARY KEY AUTOINCREMENT, 
  val TEXT
);

Post Reply