dotConnect for Mailchimp Documentation
Devart.Data.MailChimp Namespace / MailChimpMonitor Class
Members Example

In This Topic
    MailChimpMonitor Class
    In This Topic
    Monitors dynamic SQL execution in applications that use dotConnect for Mailchimp.
    Syntax
    'Declaration
     
    Public NotInheritable Class MailChimpMonitor 
       Inherits Devart.Common.DbMonitorHelper
       Implements System.ComponentModel.IComponentSystem.IDisposable 
    Remarks

    To enable monitoring just drop MailChimpMonitor component to the form and set IsActive property to true. If dbMonitor application has already been started you can see messages and SQL statements that your application executes. For monitoring you need only one MailChimpMonitor component on any of the forms your application consists of.

    For example on how to trap SQL events in your application please refer to description of TraceEvent event of Devart.Common.DbMonitor.

    For monitoring multithreaded applications with dbMonitor tool you have to specify ApartmentState.MTA attribute as shown in the example below.

    See also Using dbMonitor topic.

    Example
    This sample shows how to enable SQL monitoring in console and web applications. To activate monitoring for web applications, a Devart.Data.MailChimp.MailChimpMonitor object may be added to the Application collection at the first load of the default page.
    // Console application
    [MTAThread]
    static void Main(string[] args)
    {
            MailChimpMonitor mailchimpMonitor = new MailChimpMonitor();
            mailchimpMonitor.IsActive = true;
            ...
    }
    
    // Web application
    void Page_Load(object sender, EventArgs e)
    {
            if (Application["mon"] == null)
            Application.Add("mon", new Devart.Data.MailChimp.MailChimpMonitor() {IsActive = true});
    }
    ' Console application
    <MTAThread()> _
    Sub Main()
            Dim mailchimpMonitor As MailChimpMonitor = New MailChimpMonitor
            mailchimpMonitor.IsActive = True
            ...
    End Sub
    
    // Web application
    Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
            If Application("mon") Is Nothing Then
                    Application.Add("mon", New Devart.Data.MailChimp.MailChimpMonitor() With {.IsActive = True})
        End If
    End Sub
    Inheritance Hierarchy

    System.Object
       System.MarshalByRefObject
          System.ComponentModel.Component
             Devart.Common.DbMonitor
                Devart.Common.DbMonitorHelper
                   Devart.Data.MailChimp.MailChimpMonitor

    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