dotConnect Universal Documentation
Devart.Data.Universal Namespace / UniMonitor Class
Members Example

UniMonitor Class
Allows to monitor dynamic SQL execution in applications that use Universal .NET.
Syntax
'Declaration
 
Public Class UniMonitor 
   Inherits Devart.Common.DbMonitorHelper
   Implements System.ComponentModel.IComponentSystem.IDisposable 
 
Remarks

To enable monitoring just drop UniMonitor 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 UniMonitor 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.

Example
This sample shows how to enable SQL monitoring in a console application.
[MTAThread]
static void Main(string[] args)
{
  UniMonitor myMonitor = new UniMonitor();
  myMonitor.IsActive = true;
  ...
}
<MTAThread()> _
Sub Main()
  Dim myMonitor As UniMonitor = New UniMonitor
  myMonitor.IsActive = True
  ...
End Sub
Inheritance Hierarchy

System.Object
   System.MarshalByRefObject
      System.ComponentModel.Component
         Devart.Common.DbMonitor
               Devart.Data.Universal.UniMonitor

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