views:

96

answers:

2

-edit- nevermind, i made a mistake in my select statement. Update was working correctly.

I am not sure why but my sqlite DB isnt updating. I can see that this query returns 1 for a table that is affected but when i close my app or run a certain select statement it is as if this update never happened. 2 notes. 1) My inserts work fine, 2) there are NO transactions in my code.

void update(long pid, RetType dlStatus, Type type)
{
    command.CommandText = "UPDATE table SET dlStatus=@dlStatus, type=@type WHERE pid=@pid;";
    command.Parameters.Add("@dlStatus", System.Data.DbType.Int64).Value = dlStatus;
    command.Parameters.Add("@type", System.Data.DbType.Int64).Value = type;
    command.Parameters.Add("@pid", System.Data.DbType.Int64).Value = pid;
    int v = command.ExecuteNonQuery(); //v==1 so....
    v++;
}
A: 

If auto commit is turned off by default you won't see that UPDATE appear.

The SQL Lite site says it's turned on by default.

http://www.sqlite.org/c3ref/get%5Fautocommit.html

Your table is named "table"? I would imagine that using a keyword might be problematic. Do you quote it in your other queries?

http://www.sqlite.org/lang%5Fkeywords.html

duffymo
A: 

Have you run commit?

wierob