Last post Nov 26, 2010 02:32 PM by sachingusain
Nov 24, 2010 10:28 PM|greecemonkey|LINK
Most of my DAL functions use structures to pass the data back to the BLL and to the UI. I have got the try catch code now and it all works fine. I capture the exceptions in a seperate db table and it all works fine.
I wanted to know how to pass the error up and what varable would be used to hold the error status
What I was think was - if I had a BO structure that was used to in the DAL and was populated and I wanted the error state up do I need to have a specific error field in the structure.
Public type as string
public color as string
public size as string
public errorstate as boolean / int16
I can see how you can set the errorstate to true or false or to a value in the DAL, but having the error state in the structure does not seem to fit very well as it is mixing real data and errors in the same bo
Is this the right way to do this ?
Nov 25, 2010 03:54 AM|greecemonkey|LINK
I have been reading about this some more
I understand that it is prefered to throw exceptions rather than include the info in the structure.
What would be the best way to convert an exception to a friendly message.
Can I catch the error set it to an enum using select case and then get the enum value at the UI and convert it to a user friendly message
Nov 26, 2010 02:32 PM|sachingusain|LINK
If you really need to then you can define your own exception classes derived from
ApplicationException. There you can set error messages that make sense to you and you can trap those in your application.