VistaDB 6
VistaDB.DDA Namespace / IVistaDBDatabase Interface / RegisterClrTrigger Method
The CLR Trigger custom name to register
The full name of CLR Trigger hosted method. The name should include namespace the CLR Trigger belongs to. The procedure should be static
The name of assembly registered in database with CreateAssembly or UpdateAssembly
The name of table the trigger is set on
The table level event to fire trigger
User's description for this procedure. May be null (Nothing in VB.NET) to exclude a description.


In This Topic
    RegisterClrTrigger Method
    In This Topic
    Looks for CLR Trigger in assembly. If CLR Trigger found, registers user provided name.
    Syntax
    'Declaration
     
    
    Sub RegisterClrTrigger( _
       ByVal triggerName As System.String, _
       ByVal clrHostedMethod As System.String, _
       ByVal assemblyName As System.String, _
       ByVal tableName As System.String, _
       ByVal triggerAction As TriggerAction, _
       ByVal description As System.String _
    ) 
    'Usage
     
    
    Dim instance As IVistaDBDatabase
    Dim triggerName As System.String
    Dim clrHostedMethod As System.String
    Dim assemblyName As System.String
    Dim tableName As System.String
    Dim triggerAction As TriggerAction
    Dim description As System.String
     
    instance.RegisterClrTrigger(triggerName, clrHostedMethod, assemblyName, tableName, triggerAction, description)
    void RegisterClrTrigger( 
       System.string triggerName,
       System.string clrHostedMethod,
       System.string assemblyName,
       System.string tableName,
       TriggerAction triggerAction,
       System.string description
    )

    Parameters

    triggerName
    The CLR Trigger custom name to register
    clrHostedMethod
    The full name of CLR Trigger hosted method. The name should include namespace the CLR Trigger belongs to. The procedure should be static
    assemblyName
    The name of assembly registered in database with CreateAssembly or UpdateAssembly
    tableName
    The name of table the trigger is set on
    triggerAction
    The table level event to fire trigger
    description
    User's description for this procedure. May be null (Nothing in VB.NET) to exclude a description.
    Remarks
    Current version supports DML triggers. Only AfterInsert, AfterUpdate and AfterDelete actions supported by CLR Triggers

    Also note that the DLL containing the CLR Trigger is loaded INTO the database and is no longer required. This is to prevent a situation where the DLL is deleted or no longer with the database causing the database to no longer work.

    During development of a CLR Trigger you will have to Unregister and Register the CLRTrigger into the database each time you rebuild your DLL for the changes to be loaded. The database does not look at the DLL after this initial registration.

    Requirements

    Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also