.NETGURU
Throwing an exception
Messages   Related Types
This message was discovered on microsoft.public.dotnet.framework.remoting.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.
Post a new message to this list...

Charlie (VIP)
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
Reply to this message...
 
    
Lord2702
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" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
 
System.ApplicationException
System.Data.DataTable
System.Exception
System.IDisposable
System.Runtime.Serialization.ISerializable




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification