Determine if a certain query had been successfully processed

Hi, I have a page (i.e. page1.aspx) that a user will select from the record and it will press on the delete button. And it will redirect on another page (i.e. page2.aspx). On page2.aspx, I wrote my query for example

DELETE FROM items WHERE item_id=2

how may I know if the query was successfully processed because I have to redirect again on the first page.

Why are you redirecting to page2.aspx to delete a record? If it fails it will give you an error

Because in page2.aspx, I’ll confirm if the user really like to delete the specified record.

If you use ExecuteNonQuery, it returns an integer indicating rows effected.

Thank you so much to both of you. :slight_smile: