Click here to Skip to main content
15,887,027 members
Home / Discussions / C#
   

C#

 
AnswerRe: update command in sqladapter Pin
OriginalGriff6-Mar-14 4:39
mveOriginalGriff6-Mar-14 4:39 
SuggestionRe: update command in sqladapter Pin
Richard Deeming6-Mar-14 5:05
mveRichard Deeming6-Mar-14 5:05 
GeneralRe: update command in sqladapter Pin
OriginalGriff6-Mar-14 5:10
mveOriginalGriff6-Mar-14 5:10 
QuestionRe: update command in sqladapter Pin
Moneyzz Sharma6-Mar-14 5:35
Moneyzz Sharma6-Mar-14 5:35 
AnswerRe: update command in sqladapter Pin
OriginalGriff6-Mar-14 6:29
mveOriginalGriff6-Mar-14 6:29 
GeneralRe: update command in sqladapter Pin
Moneyzz Sharma6-Mar-14 8:14
Moneyzz Sharma6-Mar-14 8:14 
GeneralRe: update command in sqladapter Pin
OriginalGriff6-Mar-14 8:27
mveOriginalGriff6-Mar-14 8:27 
QuestionTranslating an "error event" to a managed exception Pin
Bernhard Hiller5-Mar-14 4:17
Bernhard Hiller5-Mar-14 4:17 
I am creating a wrapper for a ThirdParty component. That component offers an event in case of an error:
C#
public delegate bool ErrorOccurred(string id, string message);
Of course, I'd prefer a custom exception, and wrote a class for that.
But there is a catch: I must return true to ThirdParty to indicate that we took care of the error, otherwise ThirdParty is likely to crash...
I subscribed to that event, and in the handler I try to do:
C#
protected bool Session_ErrorOccurred(string id, string message)
{
    throw new SASException(id, message);
    return true;
}
... but that doesn't work, of course.
I thought of throwing in a different thread (ThirdParty is multi-threaded anyway), but with
C#
protected bool Session_ErrorOccurred(string id, string message)
{
    Thread t = new Thread(() => ThrowSASException(id, message));
    t.Start();
    return true;
}
private void ThrowSASException(string id, string message)
{
    throw new SASException(id, message);
}
the exception gets swallowed somewhere in nirwana.

What do you suggest?
AnswerRe: Translating an "error event" to a managed exception Pin
Ravi Bhavnani5-Mar-14 4:25
professionalRavi Bhavnani5-Mar-14 4:25 
GeneralRe: Translating an "error event" to a managed exception Pin
OriginalGriff5-Mar-14 4:38
mveOriginalGriff5-Mar-14 4:38 
GeneralRe: Translating an "error event" to a managed exception Pin
Ravi Bhavnani5-Mar-14 4:46
professionalRavi Bhavnani5-Mar-14 4:46 
GeneralRe: Translating an "error event" to a managed exception Pin
OriginalGriff5-Mar-14 5:13
mveOriginalGriff5-Mar-14 5:13 
GeneralRe: Translating an "error event" to a managed exception Pin
BobJanova5-Mar-14 5:46
BobJanova5-Mar-14 5:46 
AnswerRe: Translating an "error event" to a managed exception Pin
Shameel5-Mar-14 5:07
professionalShameel5-Mar-14 5:07 
AnswerRe: Translating an "error event" to a managed exception Pin
BobJanova5-Mar-14 5:53
BobJanova5-Mar-14 5:53 
AnswerExceptions are exceptional Pin
Ennis Ray Lynch, Jr.5-Mar-14 8:58
Ennis Ray Lynch, Jr.5-Mar-14 8:58 
AnswerRe: Translating an "error event" to a managed exception Pin
jschell5-Mar-14 9:41
jschell5-Mar-14 9:41 
GeneralRe: Translating an "error event" to a managed exception Pin
Bernhard Hiller5-Mar-14 20:17
Bernhard Hiller5-Mar-14 20:17 
QuestionPlease help me. don't working save button Pin
bayaa4-Mar-14 23:03
bayaa4-Mar-14 23:03 
SuggestionRe: Please help me. don't working save button Pin
Richard Deeming4-Mar-14 23:13
mveRichard Deeming4-Mar-14 23:13 
GeneralMessage Closed Pin
6-Mar-14 3:15
FesAlex6-Mar-14 3:15 
GeneralRe: Please help me. don't working save button Pin
Pete O'Hanlon6-Mar-14 3:32
mvePete O'Hanlon6-Mar-14 3:32 
GeneralRe: Please help me. don't working save button Pin
thatraja6-Mar-14 3:59
professionalthatraja6-Mar-14 3:59 
GeneralRe: Please help me. don't working save button Pin
bayaa6-Mar-14 16:09
bayaa6-Mar-14 16:09 
GeneralRe: Please help me. don't working save button Pin
bayaa6-Mar-14 16:10
bayaa6-Mar-14 16:10 

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.