I got this in an interview question.
You have an asp.net page, with a sql backend. You run the asp page, the form comes up, you enter the data in the fields. click submit and the page comes back with no errors / exceptions thrown.
You look in the database table, and there are no values entered in the appropriate tables.
How would you debug this issue?
There are tons of ways to approach debugging this issue. A few that come to mind would be using a profiler. SqlServer has a profiling tool that allows you to see all transactions being executed against the database. I would imagine most other commercial databases have something similar.
You’re using asp.net, so I would assume Visual Studio is available which has rich debugging tools to test your Data Access logic.
My procedure would first be to debug my code and ensure there are no logical errors. I’d probably look at the method that is calling the stored procedure that inserts data into the database and insure the data being mapped to the parameters of the procedure is correct. I would then execute the procedure and ensure there were no exceptions being “swallowed” in my code. If this passes I would be confident that it’s a problem with the database and I would move on to profiling/reviewing the logic of my stored procedure, including debugging the procedure with the value being sent to the proc from the code.
Hope this helps.