PipelineComponent.BufferManager 属性
Gets the IDTSBufferManager100 of the pipeline component.
此 API 不符合 CLS。
命名空间: Microsoft.SqlServer.Dts.Pipeline
程序集: Microsoft.SqlServer.PipelineHost(在 Microsoft.SqlServer.PipelineHost.dll 中)
语法
声明
<CLSCompliantAttribute(False)> _
Public ReadOnly Property BufferManager As IDTSBufferManager100
Get
用法
Dim instance As PipelineComponent
Dim value As IDTSBufferManager100
value = instance.BufferManager
[CLSCompliantAttribute(false)]
public IDTSBufferManager100 BufferManager { get; }
[CLSCompliantAttribute(false)]
public:
property IDTSBufferManager100^ BufferManager {
IDTSBufferManager100^ get ();
}
[<CLSCompliantAttribute(false)>]
member BufferManager : IDTSBufferManager100
function get BufferManager () : IDTSBufferManager100
属性值
类型:Microsoft.SqlServer.Dts.Pipeline.Wrapper.IDTSBufferManager100
The IDTSBufferManager100 object.
注释
The BufferManager is a read only, execution-time property that is first available to components in the PreExecute method.
The FindColumnByLineageID method is used to locate a component's columns in the IDTSInputColumnCollection100 or IDTSOutputColumnCollection100 of the component, in the PipelineBuffer. This is necessary because the number of columns contained in the PipelineBuffer may exceed the number of columns expected by the component.
The BufferManager is also used to create new IDTSBuffer100 objects using the CreateBuffer, CreateFlatBuffer, and CreateVirtualBuffer methods. However, these methods are not supported from managed code, and should only be used when writing native C++ components.
示例
The following code example shows how to use the BufferManager property to locate the columns in a PipelineBuffer row.
using System;
using Microsoft.SqlServer.Dts.Pipeline;
using Microsoft.SqlServer.Dts.Pipeline.Wrapper;
using Microsoft.SqlServer.Dts.Runtime.Wrapper;
namespace Microsoft.Samples.SqlServer.Dts
{
public class SampleComponent : PipelineComponent
{
public override void ProcessInput( int InputID, PipelineBuffer buffer )
{
IDTSInput100 i = ComponentMetaData.InputCollection.GetObjectByID( InputID );
foreach( IDTSInputColumn100 col in i.InputColumnCollection)
{
int colIndex = BufferManager.FindColumnByLineageID(i.Buffer, col.LineageID);
BufferColumn bc =buffer.GetColumnInfo(colIndex);
}
}
}
}
Imports System
Imports Microsoft.SqlServer.Dts.Pipeline
Imports Microsoft.SqlServer.Dts.Pipeline.Wrapper
Imports Microsoft.SqlServer.Dts.Runtime.Wrapper
Namespace Microsoft.Samples.SqlServer.Dts
Public Class SampleComponent
Inherits PipelineComponent
Public Overrides Sub ProcessInput(ByVal InputID As Integer, ByVal buffer As PipelineBuffer)
Dim i As IDTSInput100 = ComponentMetaData.InputCollection.GetObjectByID(InputID)
For Each col As IDTSInputColumn100 In i.InputColumnCollection
Dim colIndex As Integer = BufferManager.FindColumnByLineageID(i.Buffer, col.LineageID)
Dim bc As BufferColumn = buffer.GetColumnInfo(colIndex)
Next
End Sub
End Class
End Namespace