Класс 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 nullNothingnullptrunitпустая ссылка (Nothing в Visual Basic).
Защищенный метод 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 nullNothingnullptrunitпустая ссылка (Nothing в Visual Basic).
Открытый метод ToString (Производный от Object.)

В начало

Поля

  Имя Описание
Защищенное поле 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

Безопасность многопоточности

Любые открытые статический (Shared в Visual Basic) элементы этого типа потокобезопасны. Потокобезопасность с элементами экземпляров не гарантируется.