EventChronicle Constructor ()

Initializes a new EventChronicle.

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

语法

声明
Public Sub New
public EventChronicle ()
public:
EventChronicle ()
public EventChronicle ()
public function EventChronicle ()

备注

已更新的文本:2005 年 12 月 5 日

已更新的示例代码:2005 年 12 月 5 日

If you use the default constructor, you must immediately set the Name property and then set the Parent property. You can then set other properties.

示例

The following examples show how to use this default constructor:

// Define a chronicle for the class
EventChronicle ec1 = new EventChronicle();
ec1.Name = "FlightEventChonicle";
ec1.Parent = flightEvents;
ec1.SqlStatements.Add("CREATE TABLE dbo.FlightEventChronicle " + 
    " (LeavingFrom nvarchar(6), GoingTo nvarchar(6), " +  
    " Price float);");
ec1.SqlStatements.Add("CREATE INDEX FlightEventChronicleIndex  " + 
    "ON dbo.FlightEventChronicle " + 
    "( LeavingFrom, GoingTo );");
flightEvents.EventChronicles.Add(ec1);
' Define a chronicle for the class
Dim ec1 As EventChronicle = New EventChronicle()
ec1.Name = "FlightEventChonicle"
ec1.Parent = flightEvents
ec1.SqlStatements.Add("CREATE TABLE dbo.FlightEventChronicle " + _
    " (LeavingFrom nvarchar(6), GoingTo nvarchar(6), " + _
    " Price float);")
ec1.SqlStatements.Add("CREATE INDEX FlightEventChronicleIndex  " + _
"ON dbo.FlightEventChronicle " + _
"( LeavingFrom, GoingTo );")
flightEvents.EventChronicles.Add(ec1)

平台

开发平台

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

目标平台

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

请参阅

参考

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

其他资源

为事件类定义历史记录
Chronicle Element for EventClass/Chronicles (ADF)