Great video! I was having this exact problem when trying to insert duplicate data into my database (stumbling upon the default MSSQL exception catch block, even though I put it there just in case my database connection was invalid). Like you said at the end, making your own exceptions gives you control over the logic behind it and over what you do and don't want to handle. +1 sub for me (:
See newdevsguide.com/2022/11/20/custom-csharp-exceptions/ for more details and code.
Great video! I was having this exact problem when trying to insert duplicate data into my database (stumbling upon the default MSSQL exception catch block, even though I put it there just in case my database connection was invalid). Like you said at the end, making your own exceptions gives you control over the logic behind it and over what you do and don't want to handle. +1 sub for me (:
Awesome 😎👍
Thank you!