Click here to Skip to main content
15,919,613 members
Home / Discussions / C#
   

C#

 
GeneralRe: associate the ContextMenu Pin
Syed Abdul Khader4-May-04 5:44
Syed Abdul Khader4-May-04 5:44 
Generaldrop down list in c# Pin
mrv114-May-04 2:01
mrv114-May-04 2:01 
GeneralRe: drop down list in c# Pin
Bill Dean4-May-04 4:31
Bill Dean4-May-04 4:31 
GeneralRe: drop down list in c# Pin
Heath Stewart4-May-04 4:43
protectorHeath Stewart4-May-04 4:43 
GeneralID3 decision tree algorithm in C# Pin
Member 7511394-May-04 1:15
Member 7511394-May-04 1:15 
GeneralRe: ID3 decision tree algorithm in C# Pin
leppie4-May-04 7:13
leppie4-May-04 7:13 
GeneralException Reporting Pin
sreejith ss nair4-May-04 1:13
sreejith ss nair4-May-04 1:13 
GeneralRe: Exception Reporting Pin
Colin Angus Mackay4-May-04 1:28
Colin Angus Mackay4-May-04 1:28 
I am guessing Method B does some exception handling, which is why it is being caught there and not in Method A.

public void MethodA()
{
    string errorMessage = MethodB();
    if (errorMessage != "")
    {
        // Show the message to the user
    }
}

public string MethodB()
{
    try
    {
        MethodC();
    }
    catch(Exception ex)
    {
        // Do some error handling
        return ex.Message
    }
    return "";
}

public void MethodC()
{
    // Do something that can potentially go wrong
    throw(new ApplicationException("Something went wrong"));
}


This is one way of doing it. But, as you've not expressed fully what you are trying to do, it may not fit with the design of your application.

Does this help?


"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar

Coming soon: The Second EuroCPian Event


QuestionHow to customize PropertyGrid ToolTip Pin
LotusM4-May-04 0:53
LotusM4-May-04 0:53 
Generalcombobox datasource Pin
brain2cpu4-May-04 0:21
professionalbrain2cpu4-May-04 0:21 
GeneralRe: combobox datasource Pin
Colin Angus Mackay4-May-04 0:42
Colin Angus Mackay4-May-04 0:42 
GeneralUpdating More than One table Pin
sreejith ss nair3-May-04 23:46
sreejith ss nair3-May-04 23:46 
GeneralRe: Updating More than One table Pin
Heath Stewart4-May-04 4:13
protectorHeath Stewart4-May-04 4:13 
GeneralAlan Murta's - General Polygon Clipper Pin
d-mon3-May-04 22:55
d-mon3-May-04 22:55 
GeneralRe: Alan Murta's - General Polygon Clipper Pin
Daniel Turini4-May-04 0:07
Daniel Turini4-May-04 0:07 
GeneralRe: Alan Murta's - General Polygon Clipper Pin
Heath Stewart4-May-04 3:52
protectorHeath Stewart4-May-04 3:52 
GeneralRe: Alan Murta's - General Polygon Clipper Pin
d-mon5-May-04 10:41
d-mon5-May-04 10:41 
QuestionBest C# IRC Channel? Pin
Marlun3-May-04 22:36
Marlun3-May-04 22:36 
AnswerRe: Best C# IRC Channel? Pin
Heath Stewart4-May-04 3:47
protectorHeath Stewart4-May-04 3:47 
GeneralRe: Best C# IRC Channel? Pin
Marlun4-May-04 6:27
Marlun4-May-04 6:27 
GeneralRe: Best C# IRC Channel? Pin
Heath Stewart4-May-04 8:02
protectorHeath Stewart4-May-04 8:02 
GeneralRe: Best C# IRC Channel? Pin
Marlun4-May-04 10:08
Marlun4-May-04 10:08 
GeneralRe: Best C# IRC Channel? Pin
eggie54-May-04 15:54
eggie54-May-04 15:54 
GeneralRe: Best C# IRC Channel? Pin
Marlun4-May-04 20:23
Marlun4-May-04 20:23 
GeneralRe: Best C# IRC Channel? Pin
eggie55-May-04 2:01
eggie55-May-04 2:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.