Click here to Skip to main content
15,908,907 members
Home / Discussions / C#
   

C#

 
GeneralRe: CachedBitmap Pin
mhmoud rawas14-Nov-03 20:16
mhmoud rawas14-Nov-03 20:16 
Questionhow to control web components in winform by embeding a browser(ie) Pin
nakey_yang12-Nov-03 18:45
nakey_yang12-Nov-03 18:45 
AnswerRe: how to control web components in winform by embeding a browser(ie) Pin
mhmoud rawas12-Nov-03 18:57
mhmoud rawas12-Nov-03 18:57 
AnswerRe: how to control web components in winform by embeding a browser(ie) Pin
Heath Stewart13-Nov-03 3:36
protectorHeath Stewart13-Nov-03 3:36 
GeneralRe: how to control web components in winform by embeding a browser(ie) Pin
J. Dunlap13-Nov-03 8:38
J. Dunlap13-Nov-03 8:38 
AnswerRe: how to control web components in winform by embeding a browser(ie) Pin
Heath Stewart13-Nov-03 3:47
protectorHeath Stewart13-Nov-03 3:47 
GeneralRe: how to control web components in winform by embeding a browser(ie) Pin
J. Dunlap13-Nov-03 8:26
J. Dunlap13-Nov-03 8:26 
GeneralCOM+ Transaction 70-320 exam question Pin
CillyMe12-Nov-03 17:52
CillyMe12-Nov-03 17:52 
COM+ Transaction 70-320 exam question

[Transaction(TransactionOption.Required)]
[SecurityRole("Admin")]
public class SalesProcessor
{
public void PlaceOrder()
{
//STEP 1: Code here to insert order to order table, calling method on another COM+ component participating in the transaction.
objCOM1.InsertOrder(...);

//STEP 2: Code here to update shipping table. Again, calling method on a second COM+ component participating in the transaction.
objCOM2.UpdateShipping(...);
}
}

The question is, what do you need to add in order for the transaction initiated by PlaceOrder to be executed properly. You options are:
a. Add [AutoComplete(true)] to PlaceOrder
b. Add EnableCommit( ) to "End" of PlaceOrder method.
c. ... not viable option ...
d. ... not viable option ...

The model answer is "EnableCommit" (That's option *b*). But I don't understand why. I never used EnableCommit( ) before, never had to. If I don't use [AutoComplete(true)] to automatically call SetComplete and SetAbort, I'd do it manually:

public void PlaceOrder()
{
ContextUtil.EnableCommit( ); //Is this how you use EnableCommit()? But "option b" suggested that it should be added at the END of the method after the processing... That's weird.
try
{
objCOM1.InsertOrder(...);
objCOM2.UpdateShipping(...);
ContextUtil.SetComplete(...);
}
catch(Exception er)
{
... exception prcessing ...
ContextUtil.SetAbort( );
}
}

Otherwise, [AutoComplete(true)] would do the job:

[AutoComplete(true)]
public void PlaceOrder()
{
objCOM1.InsertOrder(...);
objCOM2.UpdateShipping(...);
}

Thanks.
GeneralFileDialog in WEB forms application Pin
Rostrox12-Nov-03 17:22
Rostrox12-Nov-03 17:22 
GeneralRe: FileDialog in WEB forms application Pin
Heath Stewart13-Nov-03 3:20
protectorHeath Stewart13-Nov-03 3:20 
GeneralQuestion about threads Pin
zhang_ding12-Nov-03 15:53
zhang_ding12-Nov-03 15:53 
GeneralRe: Question about threads Pin
mhmoud rawas13-Nov-03 0:44
mhmoud rawas13-Nov-03 0:44 
GeneralRe: Question about threads Pin
zhang_ding13-Nov-03 16:24
zhang_ding13-Nov-03 16:24 
GeneralNet Send Emulator Pin
obelisk2912-Nov-03 8:28
obelisk2912-Nov-03 8:28 
GeneralRe: Net Send Emulator Pin
Anonymous12-Nov-03 8:42
Anonymous12-Nov-03 8:42 
GeneralRe: Net Send Emulator Pin
obelisk2912-Nov-03 8:46
obelisk2912-Nov-03 8:46 
GeneralRe: Net Send Emulator Pin
Heath Stewart12-Nov-03 9:03
protectorHeath Stewart12-Nov-03 9:03 
GeneralRe: Net Send Emulator Pin
obelisk2912-Nov-03 9:58
obelisk2912-Nov-03 9:58 
GeneralRe: Net Send Emulator Pin
Daniel M. Edwards12-Nov-03 13:33
Daniel M. Edwards12-Nov-03 13:33 
GeneralRe: Net Send Emulator Pin
Heath Stewart12-Nov-03 8:59
protectorHeath Stewart12-Nov-03 8:59 
GeneralRe: Net Send Emulator Pin
obelisk2912-Nov-03 9:02
obelisk2912-Nov-03 9:02 
GeneralRe: Net Send Emulator Pin
obelisk2912-Nov-03 10:01
obelisk2912-Nov-03 10:01 
GeneralRe: Net Send Emulator Pin
Heath Stewart12-Nov-03 10:30
protectorHeath Stewart12-Nov-03 10:30 
GeneralRe: Net Send Emulator Pin
obelisk2912-Nov-03 10:38
obelisk2912-Nov-03 10:38 
GeneralRe: Net Send Emulator Pin
Heath Stewart12-Nov-03 10:44
protectorHeath Stewart12-Nov-03 10:44 

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.