ScriptBuffer 类

Serves as the base class for the read-only classes representing the input and the outputs that are generated by the Script component in the BufferWrapper project item in a Script component project.

继承层次结构

System.Object
  Microsoft.SqlServer.Dts.Pipeline.ScriptBuffer

命名空间:  Microsoft.SqlServer.Dts.Pipeline
程序集:  Microsoft.SqlServer.TxScript(在 Microsoft.SqlServer.TxScript.dll 中)

语法

声明
Public Class ScriptBuffer
用法
Dim instance As ScriptBuffer
public class ScriptBuffer
public ref class ScriptBuffer
type ScriptBuffer =  class end
public class ScriptBuffer

ScriptBuffer 类型公开以下成员。

构造函数

  名称 说明
公共方法 ScriptBuffer Initializes a new instance of the ScriptBuffer class.

页首

属性

  名称 说明
受保护属性 Item Gets or sets the value of a column in the buffer by using its index in the array of buffer column indexes.

页首

方法

  名称 说明
受保护方法 AddRow Adds an empty new row to the data flow buffer.
受保护方法 DirectRow Directs a row to the specified output when a component has more than one available output.
受保护方法 EndOfRowset Returns a value that indicates whether the end of the rows in a buffer has been reached.
公共方法 Equals (从 Object 继承。)
受保护方法 Finalize (从 Object 继承。)
公共方法 GetHashCode (从 Object 继承。)
公共方法 GetType (从 Object 继承。)
受保护方法 IsNull Returns a value that indicates whether the value of the specified column is nullnull 引用(在 Visual Basic 中为 Nothing).
受保护方法 MemberwiseClone (从 Object 继承。)
受保护方法 NextRow Tries to move to the next available row in the buffer and returns a value that indicates whether another row was available.
受保护方法 SetEndOfRowset Indicates to the data flow that no more rows will be added to the output buffer.
受保护方法 SetNull Makes the value of the specified column nullnull 引用(在 Visual Basic 中为 Nothing).
公共方法 ToString (从 Object 继承。)

页首

字段

  名称 说明
受保护字段 Buffer The script buffer.
受保护字段 BufferColumnIndexes An array of column indexes.

页首

注释

The ScriptBuffer class serves as the base class for the read-only classes representing the input and the outputs that are generated by the Script component in the BufferWrapper project item in a Script component project. The classes in the BufferWrapper project item provide the developer with a set of methods for working with the data flow buffers, as well as typed accessor properties for each column in the buffers.

The Script component developer does not use the ScriptBuffer class directly, but indirectly, through the derived classes in the BufferWrapper project item that represent the component's input and outputs.

For more information, see 脚本组件的编码和调试 and 了解脚本组件对象模型.

示例

The following code sample from 使用脚本组件创建异步转换 demonstrates several methods and properties of the ScriptBuffer class, including AddRow, NextRow, EndOfRowset, and SetEndOfRowset.

Public Class ScriptMain
    Inherits UserComponent

    Private myRedmondAddressCount As Integer

    Public Overrides Sub CreateNewOutputRows()

        MySummaryOutputBuffer.AddRow()

    End Sub

    Public Overrides Sub MyAddressInput_ProcessInput(ByVal Buffer As MyAddressInputBuffer)

        While Buffer.NextRow()
            MyAddressInput_ProcessInputRow(Buffer)
        End While

        If Buffer.EndOfRowset Then
            MyAddressOutputBuffer.SetEndOfRowset()
            MySummaryOutputBuffer.MyRedmondCount = myRedmondAddressCount
            MySummaryOutputBuffer.SetEndOfRowset()
        End If

    End Sub

    Public Overrides Sub MyAddressInput_ProcessInputRow(ByVal Row As MyAddressInputBuffer)

        With MyAddressOutputBuffer
            .AddRow()
            .AddressID = Row.AddressID
            .City = Row.City
        End With

        If Row.City.ToUpper = "REDMOND" Then
            myRedmondAddressCount += 1
        End If

    End Sub

End Class

线程安全

此类型的任何公共 static(在 Visual Basic 中为 Shared) 成员都是线程安全的。不保证所有实例成员都是线程安全的。

请参阅

参考

Microsoft.SqlServer.Dts.Pipeline 命名空间