共用方式為


StopTime 屬性

Returns the time that the container ended execution. This property is read-only.

命名空間:  Microsoft.SqlServer.Dts.Runtime
組件:  Microsoft.SqlServer.ManagedDTS (在 Microsoft.SqlServer.ManagedDTS.dll 中)

語法

'宣告
ReadOnly Property StopTime As DateTime
    Get
'用途
Dim instance As IDTSExecutionMetrics
Dim value As DateTime

value = instance.StopTime
DateTime StopTime { get; }
property DateTime StopTime {
    DateTime get ();
}
abstract StopTime : DateTime
function get StopTime () : DateTime

屬性值

型別:System. . :: . .DateTime
A DateTime value that indicates when the container completed.

範例

The following code example assumes a package named pkg has been created. The package is executed, and the start time, stop time, and duration of the run is recorded. The variables are created after the package is run to capture the information. The pkg object can be replaced by any container, task, or object that inherits from DtsContainer, as DtsContainer inherits the IDTSExecutionMetrics interface.

pkg.Execute();
DateTime dtStart = pkg.StartTime;
DateTime dtStop = pkg.StopTime;
int pgkDuration = pkg.ExecutionDuration;
pkg.Execute()
Dim dtStart As DateTime =  pkg.StartTime 
Dim dtStop As DateTime =  pkg.StopTime 
Dim pgkDuration As Integer =  pkg.ExecutionDuration