2

I have a table with 1 row. log => 1 | flagLog => 0

 public async void updateFlag()
    {
        var local = Path.Combine(Windows.Storage.ApplicationData.Current.LocalFolder.Path, "hinos.sqlite");
        SQLiteAsyncConnection con = new SQLiteAsyncConnection(local, SQLiteOpenFlags.Create | SQLiteOpenFlags.ReadWrite);

        var updateFlagLog = await con.FindAsync<logon>(u => u.log == 1);
        if (updateFlagLog != null)
        {
             await con.UpdateAsync(?????);
        // update logon set flagLog = 1 where log = 1;

        }
    }

I got the row with this comand

var updateFlagLog = await con.FindAsync<logon>(u => u.log == 1);

But i dont know how i use to update this row.

2
  • Did u try updateFlagLog.flagLog = 1 and then simply con.UpdateAsync(updateFlagLog)? Commented Nov 1, 2015 at 0:47
  • @Rinecamo thx a lot man, run!! I tryed a lot of ways, but it is very simply haha Commented Nov 1, 2015 at 1:40

1 Answer 1

1

I believe you only have to pass the object you want to update.

    var updateFlagLog = await con.FindAsync<logon>(u => u.log == 1);
    if (updateFlagLog != null)
    {
         // TODO do the changes you need to updateFlagLog

         // Update the object
         await con.UpdateAsync(updateFlagLog);
    }
Sign up to request clarification or add additional context in comments.

1 Comment

ohh man almost.. with you sugestion i got and error but i fixed with @Rinecamo sugestion.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.