Local Database Data comparison to user input. RRS feed

  • Question

  • User398510 posted

    This might be a basic question but I am making a password and username verification for my app. currently i have connected a database and using: public Task> ComparePass(string Username) {

          return _database.QueryAsync<Person>("SELECT [Password] FROM [Person] WHERE [Username] = ?", Username);

    I have successfully got a list of the accounts that have the same username. I will then compare it to the password. the problem i am having is getting this into a form that i can search and compare. i have tried methods similar to this: List lists = await App.Database.ComparePass(UsernameEntry.Text); lists.ToArray(); where i have put the values in and I have uses a string.join. this didn't produce the expected results and I'm not too sure how I'm going to remove the values from the list and actually manipulate them.

    Wednesday, December 16, 2020 2:09 PM

All replies

  • User398525 posted

    If you want to query some data from database, please take a following code:

    ``` var list = _SQLiteConnection.Query("select password from User where userName= ?", "cherry"); foreach(User user in list) { if(user.password== UsernameEntry.Text) {


    } ```

    Thursday, December 17, 2020 7:46 AM