Como quieras
__
>Hi Gregory,
>
>I've checked how the procedure is declared and I see that it returns integer. But when I call it, I don't declare int and it works fine. So, from this I may assume if I would have returned string I would not need to capture the output.
>
>In any case, I think I better create a different function with slightly different functionality. I checked and the current implementation doesn't catch the error at all.
>
>>>Hi everybody,
>>>
>>>I have a static void function to execute a stored procedure. It has try/catch block, but it doesn't do anything with the exception. I was thinking I would return the exception message as a string to the calling program. The problem is - this function is used in many places and I don't want to change all of them.
>>>
>>>What would be a good way for me to retrieve the info?
>>>
>>>Is it possible to call string returning function as it doesn't return anything?
>>>
>>>Thanks in advance.
>>_
>>
>>You can overload it - one method calls the other
>>
>>
>>
>>static void SomeProc()
>>{
>> string something;
>>
>> SomeProc(out something);
>>}
>>
>>static void SomeProc( string out s)
>>{
>>
>> if( ... )
>> s = null;
>> else
>> s = "ppp"
>>}
>>
>>
>>
>>__
>>also possible (cannot test it - am without vs2008 for the moment
>>
>>
>>static void SomeProc()
>>{
>> string something;
>>
>> something = SomeProc();
>>}
>>
>>static string SomeProc( )
>>{
>>
>> if( ... )
>> return null;
>> else
>> return "ppp"
>>}
>>
Gregory