EventClass Constructor (Application, String)

Initializes a new instance of the EventClass class with an Application and a name.

命名空间: Microsoft.SqlServer.Management.Nmo
程序集: Microsoft.SqlServer.Smo (in microsoft.sqlserver.smo.dll)

语法

声明
Public Sub New ( _
    application As Application, _
    name As String _
)
public EventClass (
    Application application,
    string name
)
public:
EventClass (
    Application^ application, 
    String^ name
)
public EventClass (
    Application application, 
    String name
)
public function EventClass (
    application : Application, 
    name : String
)

参数

  • application
    The Application for the event class. This parameter sets the Parent property.
  • name
    The String of up to 255 characters that specifies the name of the event class.

    You cannot rename an event class. Instead, you must remove the event class and then add a new event class with the new name.

备注

The name of an event class must conform to Microsoft SQL Server identifier naming conventions. It also must be unique within the application. For more information about SQL Server identifier naming conventions, see 标识符.

示例

The following examples show how to use this event class constructor:

EventClass flightEvents = 
    new EventClass(myApplication, "FlightEvents");
Dim flightEvents As EventClass = _
    New EventClass(myApplication, "FlightEvents")

平台

开发平台

有关支持的平台列表,请参阅安装 SQL Server 2005 的硬件和软件要求。

目标平台

有关支持的平台列表,请参阅安装 SQL Server 2005 的硬件和软件要求。

请参阅

参考

EventClass Class
EventClass Members
Microsoft.SqlServer.Management.Nmo Namespace

其他资源

定义事件类
EventClass Element (ADF)
Application Element (ADF)
EventClassName Element for EventClass (ADF)