R
roger.dunham
Hi there,
I am writing an application that performs calculations on records
within a data table. There may be many records in a data table.
There are situations where the calculation may not be able to return a
meaningful value (e.g. Divide by zero) and null (or other default) is
returned instead. This is not a fatal error, so processing can
continue on the rest of the data table. As such, the table may
ultimately end up with a mixture of some correctly calculated and
uncalculated values.
In that situation I would like to be able to warn the user that some
values could not be calculated. Ideally I would like to be able to
tell them the records where this occurred.
I have used C# for a number of years and understand how to use
Exceptions, and Inner Exceptions. However exceptions are not
appropriate here as processing continued.
How do other developers deal with returning information about status?
Do you return a single status code (e.g. -204, which can be translated
into a helpful string such as "division by zero occurred in some
records"), or something more complex? Alternatively, have Microsoft
implemented something in .NET that I have yet to find?
Thanks in anticipation
Roger
I am writing an application that performs calculations on records
within a data table. There may be many records in a data table.
There are situations where the calculation may not be able to return a
meaningful value (e.g. Divide by zero) and null (or other default) is
returned instead. This is not a fatal error, so processing can
continue on the rest of the data table. As such, the table may
ultimately end up with a mixture of some correctly calculated and
uncalculated values.
In that situation I would like to be able to warn the user that some
values could not be calculated. Ideally I would like to be able to
tell them the records where this occurred.
I have used C# for a number of years and understand how to use
Exceptions, and Inner Exceptions. However exceptions are not
appropriate here as processing continued.
How do other developers deal with returning information about status?
Do you return a single status code (e.g. -204, which can be translated
into a helpful string such as "division by zero occurred in some
records"), or something more complex? Alternatively, have Microsoft
implemented something in .NET that I have yet to find?
Thanks in anticipation
Roger