cannot update with parameter

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for SQLite
Post Reply
betaest
Posts: 2
Joined: Mon 14 Mar 2011 13:21

cannot update with parameter

Post by betaest » Mon 14 Mar 2011 13:30

I use dotConnect for SQLite 3.10.121.0 in vs2010.

when I use this code to update some value, it's return 0

Code: Select all

            SQLiteConnection sc = new SQLiteConnection(dataConnStr);

            var cmd = sc.CreateCommand();
            cmd.CommandText = "UPDATE test SET p2 = @value WHERE p1 = @name";
            cmd.Parameters.AddWithValue("@name", "10");
            cmd.Parameters.AddWithValue("@value", "List~~~");

            sc.Open();
            Console.WriteLine(cmd.ExecuteNonQuery());
but when I direct use sql to update value, it's return 1

Code: Select all

            SQLiteConnection sc = new SQLiteConnection(dataConnStr);

            var cmd = sc.CreateCommand();
            cmd.CommandText = "UPDATE test SET p2 = 'List~~~' WHERE p1 = '10'";

            sc.Open();
            Console.WriteLine(cmd.ExecuteNonQuery());
why this? help

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Tue 15 Mar 2011 12:58

We have reproduced the problem when command fails if it contains 2 or more parameters. We will investigate the issue and notify you about the results as soon as possible.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Mon 21 Mar 2011 11:31

The bug with the SQLiteCommand object when its parameters collection contains several parameters is fixed. Look forward to the next build of dotConnect for SQLite. We plan to release it this week.

betaest
Posts: 2
Joined: Mon 14 Mar 2011 13:21

Post by betaest » Mon 21 Mar 2011 16:06

ok, thanks

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Thu 24 Mar 2011 12:19

New build of dotConnect for SQLite 3.10.126 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): http://secure.devart.com/ .
For more information, please refer to http://www.devart.com/forums/viewtopic.php?t=20588 .

Post Reply