Page 1 of 1

cannot update with parameter

Posted: Mon 14 Mar 2011 13:30
by betaest
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

Posted: Tue 15 Mar 2011 12:58
by Shalex
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.

Posted: Mon 21 Mar 2011 11:31
by Shalex
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.

Posted: Mon 21 Mar 2011 16:06
by betaest
ok, thanks

Posted: Thu 24 Mar 2011 12:19
by Shalex
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 .