I am now polishing a C # application in relation to the SQL-Server database.
It is quite simple, you can add or remove records from the SQL table through some fields from the application.
Question: In the Delete action, I made this request:
DELETE FROM table WHERE ID = @ID
It deletes what I ask to delete, BUT what if the query does not find anything in the database? How can I detect this? Since in this case the application does not delete anything, and an exception does not occur. To keep it short, I just wanted to tell the user that in this case nothing is deleted.
source share