[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Lord2702

9/2/2004 5:10:00 AM

Wed. Sep. 01, 2004 10:05 PM PT

Derive your exception class from ApplicationException, IDisposable, and
ISerializable interfaces, apply proper methods, i.e. protected
Dispose(true)/ and Dispose. and for ISerializable, GetDataObject, and a
protected ctor. In short, use custom serialization of your exception class,
and try throwing it from remoting object, you will get the DataTable object.

Good Luck.


"Charlie" <Charlie@discussions.microsoft.com> wrote in message
news:6D74964E-AA8C-4B6E-A101-EA7B6A4F86E8@microsoft.com...
> Hi guys,
>
> I have a little trouble throwing an exception in a remoting service. I'm
> calling a xyz Method passing by ref a DataTable, in the remoting service
> method I'm processing this DataTable using a for{} statement, and when I
find
> an error then a set one custom column named errorStatus on TRUE and then I
> throw the exception. If I run this service local (not remoting mode) the
> DataTable passing by ref keep the status, but If I run it using remoting
the
> DataTable don't keep the status.
>
> Check the follow code:
>
> class remotingservice : MarshallbyRef
> {
> remotingservice()
> {}
>
> public void xyz(ref DataTable data)
> {
> for (int i = 0; i < data.Count; i++)
> {
> data.Index = 0;
> // some internal process to know if the row has an error
> if (errorexist)
> {
> data.OnError = True;
> break;
> }
> }
>
> if (data.OnError)
> {
> throw new System.Exception("");
> }
> }
> }
> --
> Carlos Redondo
> .Net Developer