As Ak

As Ak

  • NA
  • 65
  • 7.6k

Data returning an old value after an update statement

Feb 8 2022 2:09 PM

Hi, I've an update statement to update a column in the database. However, after I update the value, when I try to retrieve the data, its returning an old value. 

public override async Task<UserDetail> Retrieve (UserTable user)

query = "UPDATE users SET address1 = 'Mumbai' WHERE user_id = @user_id"
var sql = oVal.Db().OpenReader(query);

Console.WriteLine(user.address1);

How to get the current value after the data is being updated in the database?

Thank you in advance.


Answers (3)