DtsContainer.LogEntryInfos Property
Returns a LogEntryInfos object. This property is read-only.
命名空間: Microsoft.SqlServer.Dts.Runtime
組件: Microsoft.SqlServer.ManagedDTS (in microsoft.sqlserver.manageddts.dll)
語法
'宣告
Public ReadOnly Property LogEntryInfos As LogEntryInfos
public LogEntryInfos LogEntryInfos { get; }
public:
property LogEntryInfos^ LogEntryInfos {
LogEntryInfos^ get ();
}
/** @property */
public LogEntryInfos get_LogEntryInfos ()
public function get LogEntryInfos () : LogEntryInfos
屬性值
A LogEntryInfos object.
備註
For more information, see Integration Services 記錄提供者.
範例
The following code example shows the Package using the Package.LogEntryInfos collection. The Package class inherits the use of the LogEntryInfos collection from DtsContainer.
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SqlServer.Dts.Runtime;
namespace LogEntryInfosTest
{
class Program
{
static void Main(string[] args)
{
// The package is one of the SSIS Samples.
string mySample = @"C:\Program Files\Microsoft SQL Server\90\Samples\Integration Services\Package Samples\CalculatedColumns Sample\CalculatedColumns\CalculatedColumns.dtsx";
// Create the Application, and load the sample.
Application app = new Application();
Package pkg= app.LoadPackage(mySample, null);
// Get the LogEntryInfos from the package.
LogEntryInfos logInfos = pkg.LogEntryInfos;
//Note how many log entries exist before adding one.
String countLEI = logInfos.Count.ToString();
Console.WriteLine("Entries at beginning: {0}", countLEI);
String newName = "My new log entry info";
String newDesc = "My new Description";
DTSLogEntryFrequency newFreq = DTSLogEntryFrequency.Consistent;
logInfos.Add(newName, newDesc, newFreq);
//Note how many log entries exist after adding one.
countLEI = logInfos.Count.ToString();
Console.WriteLine("Entries after adding one: {0}", countLEI);
//Now remove the entry just added.
logInfos.Remove("My new log entry info");
countLEI = logInfos.Count.ToString();
Console.WriteLine("Entries after Remove: {0}", countLEI);
}
}
}
Imports System
Imports System.Collections.Generic
Imports System.Text
Imports Microsoft.SqlServer.Dts.Runtime
Namespace LogEnTryInfosTest
Class Program
Shared Sub Main(ByVal args() As String)
' The package is one of the SSIS Samples.
Dim mySample As String = "C:\Program Files\Microsoft SQL Server\90\Samples\Integration Services\Package Samples\CalculatedColumns Sample\CalculatedColumns\CalculatedColumns.dtsx"
' Create the Application, and load the sample.
Dim app As Application = New Application()
Dim pkg As Package = app.LoadPackage(mySample,Nothing)
' Get the LogEntryInfos from the package.
Dim logInfos As LogEnTryInfos = pkg.LogEnTryInfos
'Note how many log entries exist before adding one.
Dim countLEI As String = logInfos.Count.ToString()
Console.WriteLine("Entries at beginning: {0}", countLEI)
Dim NewName As String = "My new log entry info"
Dim NewDesc As String = "My new Description"
Dim NewFreq As DTSLogEnTryFrequency = DTSLogEnTryFrequency.Consistent
logInfos.Add(NewName, NewDesc, NewFreq)
'Note how many log entries exist after adding one.
countLEI = logInfos.Count.ToString()
Console.WriteLine("Entries after adding one: {0}", countLEI)
'Now remove the entry just added.
logInfos.Remove("My new log entry info")
countLEI = logInfos.Count.ToString()
Console.WriteLine("Entries after Remove: {0}", countLEI)
End Sub
End Class
End Namespace
Sample Output:
Entries at beginning: 1
Entries after adding one: 2
Entries after Remove: 1
執行緒安全性
Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
平台
開發平台
如需受支援的平台清單,請參閱<安裝 SQL Server 2005 的硬體和軟體需求>。
目標平台
如需受支援的平台清單,請參閱<安裝 SQL Server 2005 的硬體和軟體需求>。
請參閱
參考
DtsContainer Class
DtsContainer Members
Microsoft.SqlServer.Dts.Runtime Namespace