Delete data

mail@pastecode.io avatar
unknown
plain_text
2 years ago
661 B
5
Indexable
Never
var result =
                MessageBox.Show(
                    "Are you sure to remove this student data? Please note that this action cannot be undone. Continue?",
                    "Remove", MessageBoxButton.YesNo, MessageBoxImage.Question);

            if (result != MessageBoxResult.Yes) return;
            await Conopen();
            Sqlcmd.Parameters.Clear();
            Strsql =
                "Delete from tbl_students where LRN='" + SelectedStudentId + "'";
            Sqlcmd.Connection = Cnn;
            Sqlcmd.CommandText = Strsql;
            Sqlcmd.ExecuteNonQuery();
            Sqlcmd.Dispose();
            Cnn.Close();