Click here to Skip to main content
15,928,330 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to receive mail in c# Pin
Luis Alonso Ramos5-Nov-04 16:46
Luis Alonso Ramos5-Nov-04 16:46 
GeneralGrid control Pin
Skynyrd5-Nov-04 13:57
Skynyrd5-Nov-04 13:57 
GeneralRe: Grid control Pin
Michael P Butler6-Nov-04 3:40
Michael P Butler6-Nov-04 3:40 
GeneralRe: Grid control Pin
Skynyrd6-Nov-04 3:59
Skynyrd6-Nov-04 3:59 
GeneralRe: Grid control Pin
RIS_20009-Dec-04 23:44
RIS_20009-Dec-04 23:44 
Generalcancel the next step Pin
webhay5-Nov-04 13:44
webhay5-Nov-04 13:44 
GeneralRe: cancel the next step Pin
Alex Korchemniy5-Nov-04 15:17
Alex Korchemniy5-Nov-04 15:17 
GeneralRe: cancel the next step Pin
Ami Bar6-Nov-04 1:17
Ami Bar6-Nov-04 1:17 
If it helps you you can use the following block:

bool success = false;

do { 

success = DoWork1();
if (!success)
   break;

success = DoWork2();
if (!success)
   break;

...

success = true;
// The argument in the while is 'false'. It's not a mistake this is the idea.
}while(false); 

if (!success)
{
  // Do rollback
}


The do{...}while(false); is a clean way not to use a goto statement.

Another way is write something like:

bool success = true;
success = success && DoWork1(); 
success = success && DoWork2(); 

if (!success)
{
  // Do rollback
}


Regards,
Ami
QuestionTemperature? Pin
bouli5-Nov-04 11:38
bouli5-Nov-04 11:38 
AnswerRe: Temperature? Pin
Alex Korchemniy5-Nov-04 15:24
Alex Korchemniy5-Nov-04 15:24 
AnswerRe: Temperature? Pin
Dave Kreskowiak6-Nov-04 2:26
mveDave Kreskowiak6-Nov-04 2:26 
GeneralRe: Temperature? Pin
bouli6-Nov-04 2:29
bouli6-Nov-04 2:29 
GeneralRe: Temperature? Pin
Dave Kreskowiak6-Nov-04 5:37
mveDave Kreskowiak6-Nov-04 5:37 
GeneralLinking into SQL's replication engine Pin
Zangarine5-Nov-04 11:13
Zangarine5-Nov-04 11:13 
GeneralRe: Linking into SQL's replication engine Pin
Alex Korchemniy5-Nov-04 15:31
Alex Korchemniy5-Nov-04 15:31 
GeneralRe: Linking into SQL's replication engine Pin
Zangarine5-Nov-04 20:50
Zangarine5-Nov-04 20:50 
GeneralRe: Linking into SQL's replication engine Pin
Dave Kreskowiak6-Nov-04 2:25
mveDave Kreskowiak6-Nov-04 2:25 
GeneralOnPaint problem Pin
Guinness4Strength5-Nov-04 11:11
Guinness4Strength5-Nov-04 11:11 
GeneralRe: OnPaint problem Pin
Palladino6-Nov-04 2:44
Palladino6-Nov-04 2:44 
General(DR["Name"] is DBNull) vs (DR["Name"] == DBNull.Value) Pin
krisp5-Nov-04 8:24
krisp5-Nov-04 8:24 
GeneralRe: (DR["Name"] is DBNull) vs (DR["Name"] == DBNull.Value) Pin
Dave Kreskowiak5-Nov-04 9:51
mveDave Kreskowiak5-Nov-04 9:51 
Generalsearch about space in staring Pin
webhay5-Nov-04 8:01
webhay5-Nov-04 8:01 
GeneralRe: search about space in staring Pin
Charlie Williams5-Nov-04 8:35
Charlie Williams5-Nov-04 8:35 
Questiondrag-drop How? Pin
ben25-Nov-04 7:31
ben25-Nov-04 7:31 
AnswerRe: drag-drop How? Pin
Alex Korchemniy5-Nov-04 14:55
Alex Korchemniy5-Nov-04 14:55 

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.