Suggestion Required
-
I want a suggestion on the following example : Is it better to throw custom exception from an method which checks before inserting employee detail that particular employee's email already registered and catch that exception in my aspx.cs page or say view layer. or return error Number, something like -999 if duplicate email found. from a method and then use conditional statement.
“You will never be a leader unless you first learn to follow and be led.” –Tiorio "Coming together is a beginning, staying together is progress, and working together is success." Henry Ford
-
I want a suggestion on the following example : Is it better to throw custom exception from an method which checks before inserting employee detail that particular employee's email already registered and catch that exception in my aspx.cs page or say view layer. or return error Number, something like -999 if duplicate email found. from a method and then use conditional statement.
“You will never be a leader unless you first learn to follow and be led.” –Tiorio "Coming together is a beginning, staying together is progress, and working together is success." Henry Ford
Exception handling is always better
-
I want a suggestion on the following example : Is it better to throw custom exception from an method which checks before inserting employee detail that particular employee's email already registered and catch that exception in my aspx.cs page or say view layer. or return error Number, something like -999 if duplicate email found. from a method and then use conditional statement.
“You will never be a leader unless you first learn to follow and be led.” –Tiorio "Coming together is a beginning, staying together is progress, and working together is success." Henry Ford
.NET in general uses exceptions, so I say stay consistent.
Christian Graus Driven to the arms of OSX by Vista. "I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )