Hey
..NET 2.0
I'm developing an application (n-tier, data acces layer (DAL), bizlayer and
presentation layer)
If for example in the DAL a stored procedure call returns no rows then I
want an exception to be thrown. So I created an custom exception called
NoRowsException and throws it.
When I tryed this the app terminated unexpectedly, because in the try /
catch block I didn't test if the exception was NoRowsException.. I had
Exception there and thought Exception took all Exceptions, but it didn't...
so it looks like I also have to test if it's an NoRowsException:
try
{
//todo
}
catch (NoRowsException norows) {}
catch (Exception exp)
any thoughts about this? could this be done in a better way?