Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

SQLite 'DeleteAsync' not permanently deleting from database

$
0
0

Hello,

I am trying to write a function that removes/deletes a row from my database. here is my code:

`async void OnDeleteExercise(object sender, System.EventArgs e)
{
var exercise = (sender as MenuItem).CommandParameter as Exercises;

        if (await DisplayAlert("Warning", $"Are you sure you want to delete {exercise.Name}?", "Yes", "No"))
        {
            _exercise.Remove(exercise);

            await _connection.DeleteAsync(exercise);
        }
    }`

When I enter this function i see the database entry removed from the screen but if exit back to my main menu and then go back to my page which allows me to add/delete/edit the exercise list i see the entry i just removed. I have researched all over the net but have not found why this DeleteAsync method does not work. Does anybody know if i am using this wrong?


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>