+1  A: 

Have you considered using an ORM like NHibernate? There's no point in re-inventing the wheel.

To me this is a code smell:

BLLCustomer cust = ((BLLCustomer)new BLLCustomer()).FillByID(34);

Too many brackets!

I've found that using the active record pattern in a language like C# always ends in tears because it's hard(er) to unit test.

jonnii
I'm sorry. :( I did a lot of lisp programming back in the day, and it's influence shows through in other languages.
stephenbayer
A: 

Why not just catch the exception in the Page_Load event? Some exception you might expect and know how to deal with, other exceptions should be handled by a global exception handler.

Manga Lee
+1  A: 

The jump from the first bit of code to the next is huge. Whether a complicated business object layer is necessary will depend on the size of the app in question. At the very least though our policy is that exceptions are logged where they are handled. How you present to the user is up to you but having logs is essential so that developers can get more information if necessary.

Luke
A: 

My rule of thumb is to only catch errors that I can handle or give the user something useful so that if they do whatever it was they did again, it is likely to work for them. I catch database exceptions; but only to add some more information onto the error about the data being used; then I re-throw it. The best way to handle errors in general is to not catch them at all anywhere but at the top of the UI stack. Just having one page to handle the errors and using the global.asax to route to it handles almost all situations. Using status codes is definitely out of style all together. It is a remnant of COM.

DancesWithBamboo
A: 

Is it possible to use an abstract base class instead of a concrete class? this would force the implementation of your methods at development time rather than runtime exceptions.

The best comment here to agree with is from dances, where you should only handle exceptions you can recover from at that point. Catching others and rethrowing is the best method (although i think its rarely done). Also, make sure they are logged.... :)

simonjpascoe
A: 

YOur way of errorhandling seems very outdated. Just make a new exeption and inherit from exeption that way you have the callstack at least. Then you should log with something like nlog or log4net. And this is the year 2008 so use generics. You will have to do a lot less casting that way.

ANd use an ORM like someone said before. Don't try to reinvent the wheel.

chrissie1
You have good points but the 2008 comment is sarcastic sounding at best.
David Robbins