473,396 Members | 1,784 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

C# Process Issue

Hi,
Does anyone know what is the equivalent of C# "ExitSub", as in VB.
I wanted to stop the processing of my procedure once an Error is encountered, therefore i wanted to use ExitSub.

With Regards
Sunny
Nov 15 '05 #1
4 3495
"Sunny" <an*******@discussions.microsoft.com> wrote in message
news:28**********************************@microsof t.com...
Hi,
Does anyone know what is the equivalent of C# "ExitSub", as in VB.
I wanted to stop the processing of my procedure once an Error is

encountered, therefore i wanted to use ExitSub.
Hi Sunny,

You can use "return". Another option to consider is the "break" statement
if you are in a loop and would like to hop out and exit cleanly at the end
of the method.

Joe
--
http://www.csharp-station.com
Nov 15 '05 #2
"Sunny" <an*******@discussions.microsoft.com> wrote in message
news:28**********************************@microsof t.com...
Hi,
Does anyone know what is the equivalent of C# "ExitSub", as in VB.
I wanted to stop the processing of my procedure once an Error is

encountered, therefore i wanted to use ExitSub.
Hi Sunny,

You can use "return". Another option to consider is the "break" statement
if you are in a loop and would like to hop out and exit cleanly at the end
of the method.

Joe
--
http://www.csharp-station.com
Nov 15 '05 #3
You would use a try catch block.
When you encounter an error condition, throw an error, and catch it in the
caller (or anywhere up the call stack)

"Sunny" <an*******@discussions.microsoft.com> wrote in message
news:28**********************************@microsof t.com...
Hi,
Does anyone know what is the equivalent of C# "ExitSub", as in VB.
I wanted to stop the processing of my procedure once an Error is encountered, therefore i wanted to use ExitSub.
With Regards
Sunny

Nov 15 '05 #4
You would use a try catch block.
When you encounter an error condition, throw an error, and catch it in the
caller (or anywhere up the call stack)

"Sunny" <an*******@discussions.microsoft.com> wrote in message
news:28**********************************@microsof t.com...
Hi,
Does anyone know what is the equivalent of C# "ExitSub", as in VB.
I wanted to stop the processing of my procedure once an Error is encountered, therefore i wanted to use ExitSub.
With Regards
Sunny

Nov 15 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Prince Kumar | last post by:
I joined a company recently and they have a java program which hangs (does nothing) after a while. This is no way consistent. It could succeed quite a few times and can fail a few other times....
10
by: Lars-Erik Aabech | last post by:
Hi! This issue have been discussed a lot, but I haven't found a solution that applies to ASP.NET. I have a library which does some operations on Excel documents, and it will be used in an...
2
by: Praveen K | last post by:
I have a problem in communicating between the C# and the Excel Interop objects. The problem is something as described below. I use Microsoft Office-XP PIA dll’s as these dll’s were been...
2
by: Sidharth | last post by:
Hello, We are experiencing some issues with the aspnet_wp process on our live servers. The problems are intermittent and we cannot reproduce it on our dev and test servers. Currently around...
3
by: iforsyth | last post by:
Hi. Running an app with System.Diagnostics.Process process with: Sample code: myproc = New System.Diagnostics.Process() strPgm = "myapp.exe" strArgs = "" myproc.StartInfo = New
7
by: Devron Blatchford | last post by:
Hi there, I am trying to develop a small menu application to run on an RF network, we are using a wavelink server to communicate with our rf scanners and run VB.NET applications on our server...
3
by: Andy | last post by:
Is there a way to force a window to close without displaying a popup asking: "Windows cannot end this program....If you choose to end the program immediately, you will lose any unsaved data." ...
10
by: Stephany Young | last post by:
When one uses the System.Diagnostics.Process.Start method to launch a common or garden Console application, one can set the WindowStyle property of the StartInfo object to ProcessWindowStyle.Hidden...
28
by: Jon Davis | last post by:
We're looking at running a memory-intensive process for a web site as a Windows service in isolation of IIS because IIS refuses to consume all of the available physical RAM. Considering remoting to...
6
by: GaryDean | last post by:
I see some references on debugging by attaching to a process. There are MSDN articles that show how to attach to a process for debugging. However, I can find no info on how exactly to get the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
0
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...
0
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,...

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.