Debugging shows that the update statement generates the following 4 errors:

http://www.ismlab.usf.edu/sqlite_errors.jpg

1. Database connection not valid for getting number of changes
        At System.Data.SQLite.SQLiteConnection.get_Changes()

2. Database connection not valid for getting last insert rowid
        At System.Data.SQLite.SQLiteConnection.get_LastInsertRowId()

3. Database connection not valid for getting maximum memory used
        At System.Data.SQLite.SQLiteConnection.get_MemoryHighwater()

4. Database connection not valid for getting memory used
        At System.Data.SQLite.SQLiteConnection.get_MemoryUsed()

Workarounds or solutions would be greatly appreciated.

Thanks
Manish

-----Original Message-----
From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] 
On Behalf Of Agrawal, Manish
Sent: Sunday, March 25, 2012 8:37 AM
To: sqlite-users@sqlite.org
Subject: [sqlite] Concurrency violation: the UpdateCommand affected 0 of the 
expected 1 records

Hello

I am getting this error when trying to update a database row in a C# 
application. The data set ds has been created using the standard Visual Studio/ 
System.Data.SQLite tools.

The table definition is:

CREATE TABLE "Test" (
        "test_Id" INTEGER PRIMARY KEY  AUTOINCREMENT  NOT NULL  UNIQUE , 
        "Points" INTEGER NOT NULL,  
        "File_Location" VARCHAR NOT NULL 
)

The C# code is:

int rowNumber = tBox.rowNumber;         // TextBox
ds.Test[rowNumber].Points = (int)points;        // from tbox
testAdapter.Update(ds.Test[rowNumber]); // ERROR THROWN HERE

Any help in resolving would be greatly appreciated.

Using Visual Studio ultimate 2010 and sqlite-1.0.79

Thanks
Manish
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to