Hi All,
What is a best way to handle an undefined value object class that returned
from a function. I have a function that call the ADO.NET ExecuteScalar()
function and returns the object to the calling function as follow:
public object FunctionA()
{
object RetVal;
... some preparation code here
RetVal = ExecuteScalar() ; // This one execute a stored procedure
which can return an empty column
Return RetVal;
}
public int FunctionB()
{
object SingleValue;
... some code here
SingleValue = FunctionA();
}
The call to the FunctionA works only if the ExecuteScalar() returns a value.
If the stored procedure returns an empty column value, and then the call to
the FunctionA() breaks out with an exception...
Any thoughts????
Comment