共用方式為


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.

命名空間:  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

備註

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

繼承階層

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

執行緒安全性

這個類型的任何公用static (在 Visual Basic 中為 Shared) 成員都是安全執行緒。不保證任何執行個體成員都可以是安全執行緒。