473,799 Members | 2,741 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Handling exceptions in .net remoting object

12 New Member
Dear Friends,

I am working on a .Net Remoting project. If there is any exception in remote object, I would like to send this exception in detail to the client. I am using the following code to accomplish that-
Expand|Select|Wrap|Line Numbers
  1. 'This is on a shared .dll
  2. Public Interface ICreateNewMouza
  3.     Function CreateNewMouza(ByVal MouzaToCreate As Mouza) As Integer
  4. End Interface
  5.  
  6. Imports System
  7. Imports System.Runtime.Serialization
  8.  
  9. <serializable()> _
  10. Public Class CustomException
  11.     Inherits System.ApplicationException
  12.  
  13.     Public Sub New(ByVal message As String)
  14.         MyBase.New(message)
  15.     End Sub
  16.  
  17.     Public Sub New(ByVal info As SerializationInfo, ByVal context As StreamingContext)
  18.         MyBase.New(info, context)
  19.     End Sub
  20.  
  21.     Public Overrides Sub GetObjectData(ByVal info As SerializationInfo, ByVal context As StreamingContext)
  22.         MyBase.GetObjectData(info, context)
  23.     End Sub
  24. End Class
  25.  
  26. 'This is remote object which a client will invoke-
  27.  
  28. Imports System.Runtime.Remoting
  29. Imports ClassInterfaces
  30.  
  31. Public Class CreateNewMouza
  32.     Inherits MarshalByRefObject
  33.     Implements ClassInterfaces.ICreateNewMouza
  34.  
  35.     Public Function CreateNewMouza(ByVal MouzaToCreate As ClassInterfaces.Mouza) As Integer Implements ClassInterfaces.ICreateNewMouza.CreateNewMouza
  36.         Try
  37.            ' some code
  38.         Catch ex As Exception
  39.           ## what should be here?
  40.         End Try
  41.  
  42.     End Function
  43. End Class
  44.  
What should be in the try.. catch block? Did i miss anything else?
Please help me.

Thanks in advance
SKPaul
Aug 20 '11 #1
0 980

Sign in to post your reply or Sign up for a free account.

Similar topics

24
2275
by: annex | last post by:
hi, i have some queries about handling exceptions, i'm using Borland c++ Builder 6. 1) what's the best way to catch multiple exceptions in one catch statement? is this possible? for e.g i want to catch 2 exceptions; MyEx1 and MyEx2, both to be handled in the same way. how to do this? try { doSomething();
5
2628
by: Sunny | last post by:
Hi, I have to implement client/server application. The client have to instaniate an remoting object via http and pass some auth info. If the auth is OK, the client should invoke a method (or sequence of methods) which will do the actual work (prepare a binary file) and return it to the client. It seems (after all the reading) that in order to prevent passing the auth info every method call, I have to implement Client activated object,...
0
999
by: Matthew Wieder | last post by:
Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <uLD8l$26DHA.3360@tk2msftngp13.phx.gbl> Newsgroups: microsoft.public.dotnet.languages.csharp NNTP-Posting-Host: 207.106.112.178 Path:...
3
6724
by: Gelios | last post by:
Hi All! Probably my question is newbie but anycase. Should I do object that I want to pass as parameter to remoting object serializable? For Example: //server public class MyServerObject {
0
1019
by: eedych | last post by:
Hi all, I am trying to do a 3-tier application to learn C#. Now I got a WinForm as GUI, a service, and a remoting object "SqlSender" to connect MSDE. I found such interesting thing. See following code snippet: // Host A - Client WinForm - MyGui .... public void buttonFind_Click(object sender, System.EventArgs e) { string cmdStr = "SELECT * FROM table";
0
839
by: Srinivasa Raghavan Sethuraman | last post by:
Hi I have .Net Service Component making a call to the Remoting Component(Server Activated Singleton) through Remoting Client. I need to set setting a configurable time-out setting for all the communication initiated with Remoting object by the remoting client. Please suggest me a solution regarding this.
2
1327
by: Anson | last post by:
Hello, I would like to clarify something about Remoting Object in .NET. Knowing from MSDN that in order for Remote Object to work, I need 3 components. a) RemotableType object, just like a regular dll with additional remotable feature. b) Host Application, which is a listener listens for remote clients of a remotable type
2
1225
by: Bob | last post by:
Is there some built-in way of handling exceptions thrown inside a thread, or do I need to pass exception conditions to a delegate (which would force me to handle all exceptions in the thread itself)? TIA, Bob
2
1568
by: Sascha Schmidt | last post by:
Hello! I would like to call a remoting object ( likely as a server activated singleton) from an IIS hosted webservice. Is this generally possible? Or is there a fundamental problem? I searched in the internet for a while, but didn't found code examples yet. Any links / source fragments are highly appreciated.
37
1911
by: Sweetiecakes | last post by:
Hello I'm a bit confused on how one should handle exceptions. I'm currently building an ADO.NET Windows Forms application. I've built a class for manipulating data within the database in question. This class is used from forms. Let's assume that there is an SQL error: this will throw an exception. Where should I handle it? How should I handle it? What to show when giving an error message? Is there any "centralized" way of handling...
0
9688
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10259
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10238
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10030
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9077
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7570
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5589
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3761
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2941
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.