title: How to update an item in database with SQLite in Xamarin forms
body: <p>I am trying to update the user infos on my app.</p>
  
  <p>I can add a user in my database but when I am trying to update its information, it is not working.</p>
  
  <p>Here is the function that change information:</p>
  
  <pre><code> public void ChangerLanguageValue(string language)
   {
       var myuser = userinfodatabase.GetUsers();
       myuser.NewsLanguage = language;     
       userinfodatabase.UpdateUserInfos(myuser); // this does not work
   }
  </code></pre>
  
  <p>Here is my database configuration :</p>
  
  <pre><code>class UserInfosDatabase
  {
      private SQLiteConnection conn;
  
      public UserInfosDatabase()
      {
          conn = DependencyService.Get&lt;ISQLite&gt;().GetConnection();
          conn.CreateTable&lt;MyUser&gt;();
      }
  
      public string AddUser(MyUser localuser)
      {
          conn.Insert(localuser);
          return "success";
      }
  
      public MyUser GetUsers()
      {
          var users = (from u in conn.Table&lt;MyUser&gt;() select u);
          return users.ToList().FirstOrDefault();
      }
  
      //Update
      public string UpdateUserInfos(MyUser localuser)
      {
          conn.Update(localuser);
          return "succes";
      }
  
  }
  </code></pre>