Last post Jun 16, 2018 12:48 PM by mgebhard
Jun 16, 2018 09:09 AM|mozina|LINK
Jun 16, 2018 12:48 PM|mgebhard|LINK
For starters, you're hiding the actual exception. That makes debugging very difficult. Do not hide exceptions.
catch (Exception ex)
Are you using the Visual Studio debugger to step through the code? If not. learn how to debug your code.
Secondly, the Rento procedure only handles an insert when rent_id=0. According to the code rent_id can be zero or a value.
Aside from the above bug, have you tried executing the stored procedure from Management Studio? Does the procedure function as expected?
In the future, do not post a bunch of code and ask why it does not work. The problem with this approach is there are always many failure points the code and code we can not see. At the very least try to debug the code and stop hiding exceptions.