About us |  Help us improve
intelliVERB - Get a fair search of the Internet !
Visual studio .net
SQL Server
Oracle
Main  >  Server components  >  COM + Email this page to friend
Client component
Compile component
Server component
 
 
 
 
 
C#Server componentTop

Using System.Reflection;
Using System.EnterpriseServices;

//set the name of our COM+ assembly
[assembly: ApplicationName("DoAllApp")]
//set the GUID of our COM+ assembly
[assembly: ApplicationID("2F7FC170-4I80-4R89-84CC-65DFB10A6F24")]
//set Informational attribute that describe our COM+ assembly
[assembly: AssemblyDescription("This application is a DoAll service component")]
//assign a strong name to our Assembly
[assembly: AssemblyKeyFile("DoAllKey.snk")]
//specify that our service component runs in the system process
//if ActivationOption.Library it will run in the creator process

[assembly: ApplicationActivation(ActivationOption.Server)]
//ObjectPooling: enable object pooling and set pool attributes
//Transaction: specifies that shared transaction is available to our serviced component

[assembly: ObjectPooling(MinPoolSize=1, MaxPoolSize=10, CreationTimeout=2000),Transaction(TransactionOption.Supported)]

public class UseComPlus:ServicedComponent
{

 /*AutoComplete:
  specify that the application should automatically
  Sets the consistent bit and the done bit to true
  in the COM+ context, if the transaction completes
  */

 [AutoComplete]
 public bool LogUserRequest(string UserId,string RequestMessage)
 {
  //TODO: call log library to do instructions
  return true;
 }
 protected override void Activate()
 {
  //TODO: log start message
 }

 protected override void Deactivate()
 {
  //TODO: log stop message
 }

 
 protected override bool CanBePooled()
 {
  // specifies that this object can be pooled.
  return(true);
 }

}


C#Client componentTop

To be implemented


C#Compile ComponentTop
Type at command prompt
sn –k DoAllKey.snk
csc /t:library /r:System.EnterpriseServices.dll UseComPlus.cs
csc /t:library /r:System.EnterpriseServices.dll ComPlusClient.cs
You last visited
DML Sql Server
 
 
Make a secure donation now with PayPal!