Skip to content

Commit 638a5a4

Browse files
authored
docs: Migrate System.Data.SqlClient to Microsoft.Data.SqlClient (Batch 3) (#36859)
Migrate 5 files from deprecated System.Data.SqlClient to Microsoft.Data.SqlClient: - 3 SSIS articles: namespace swaps in inline VB/C# code blocks - 2 FILESTREAM C# codesnippets: SqlClient + SqlTypes namespace swaps Editorial improvements (Microsoft Writing Style Guide): - Sentence case headings throughout - Future tense to present tense (will use/write -> uses/writes) - Contractions (does not -> doesn't, is not -> isn't) - may -> might for possibility - See Also -> Related content - Grammar fix (create and configuring -> create and configure) - ms.date metadata updates
1 parent e0baf22 commit 638a5a4

5 files changed

Lines changed: 64 additions & 64 deletions

File tree

docs/integration-services/extending-packages-custom-objects-data-flow-types/developing-a-custom-destination-component.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: "Developing a Custom Destination Component"
33
description: "Developing a Custom Destination Component"
44
author: chugugrace
55
ms.author: chugu
6-
ms.date: "03/16/2017"
6+
ms.date: 03/13/2026
77
ms.service: sql
88
ms.subservice: integration-services
99
ms.topic: "reference"
@@ -29,10 +29,10 @@ dev_langs:
2929

3030
This section discusses the details of how to develop destination components, and provides code examples to clarify important concepts. For a general overview of data flow component development, see [Developing a Custom Data Flow Component](../../integration-services/extending-packages-custom-objects/data-flow/developing-a-custom-data-flow-component.md).
3131

32-
## Design Time
32+
## Design time
3333
Implementing the design-time functionality of a destination component involves specifying a connection to an external data source and validating that the component has been correctly configured. By definition, a destination component has one input and possibly one error output.
3434

35-
### Creating the Component
35+
### Creating the component
3636
Destination components connect to external data sources by using <xref:Microsoft.SqlServer.Dts.Runtime.ConnectionManager> objects defined in a package. The destination component indicates its requirement for a connection manager to the [!INCLUDE[ssIS](../../includes/ssis-md.md)] Designer, and to users of the component, by adding an element to the <xref:Microsoft.SqlServer.Dts.Pipeline.Wrapper.IDTSComponentMetaData100.RuntimeConnectionCollection%2A> collection of the <xref:Microsoft.SqlServer.Dts.Pipeline.PipelineComponent.ComponentMetaData%2A>. This collection serves two purposes: first, it advertises the need for a connection manager to [!INCLUDE[ssIS](../../includes/ssis-md.md)] Designer; then, after the user has selected or created a connection manager, it holds a reference to the connection manager in the package that is being used by the component. When an <xref:Microsoft.SqlServer.Dts.Pipeline.Wrapper.IDTSRuntimeConnection100> is added to the collection, the **Advanced Editor** displays the **Connection Properties** tab, to prompt the user to select or create a connection in the package for use by the component.
3737

3838
The following code sample shows an implementation of <xref:Microsoft.SqlServer.Dts.Pipeline.PipelineComponent.ProvideComponentProperties%2A> that adds an input, and then adds a <xref:Microsoft.SqlServer.Dts.Pipeline.Wrapper.IDTSRuntimeConnection100> object to the <xref:Microsoft.SqlServer.Dts.Pipeline.Wrapper.IDTSComponentMetaData100.RuntimeConnectionCollection%2A>.
@@ -66,9 +66,9 @@ namespace Microsoft.Samples.SqlServer.Dts
6666

6767
```vb
6868
Imports System
69-
Imports System.Data
70-
Imports System.Data.SqlClient
71-
Imports Microsoft.SqlServer.Dts.Pipeline
69+
Imports System.Data
70+
Imports Microsoft.Data.SqlClient
71+
Imports Microsoft.SqlServer.Dts.Pipeline
7272
Imports Microsoft.SqlServer.Dts.Pipeline.Wrapper
7373
Imports Microsoft.SqlServer.Dts.Runtime
7474

@@ -95,7 +95,7 @@ Namespace Microsoft.Samples.SqlServer.Dts
9595
End Namespace
9696
```
9797

98-
### Connecting to an External Data Source
98+
### Connecting to an external data source
9999
After a connection is added to the <xref:Microsoft.SqlServer.Dts.Pipeline.Wrapper.IDTSComponentMetaData100.RuntimeConnectionCollection%2A>, you override the <xref:Microsoft.SqlServer.Dts.Pipeline.PipelineComponent.AcquireConnections%2A> method to establish a connection to the external data source. This method is called at design time and at run time. The component must establish a connection to the connection manager specified by the run-time connection, and subsequently, to the external data source. Once established, the component should cache the connection internally and release it when <xref:Microsoft.SqlServer.Dts.Pipeline.PipelineComponent.ReleaseConnections%2A> is called. Developers override this method, and release the connection established by the component during <xref:Microsoft.SqlServer.Dts.Pipeline.PipelineComponent.AcquireConnections%2A>. Both of these methods, <xref:Microsoft.SqlServer.Dts.Pipeline.PipelineComponent.ReleaseConnections%2A> and <xref:Microsoft.SqlServer.Dts.Pipeline.PipelineComponent.AcquireConnections%2A>, are called at design time and at run time.
100100

101101
The following code example shows a component that connects to an ADO.NET connection in the <xref:Microsoft.SqlServer.Dts.Pipeline.PipelineComponent.AcquireConnections%2A> method, and then closes the connection in <xref:Microsoft.SqlServer.Dts.Pipeline.PipelineComponent.ReleaseConnections%2A>.
@@ -158,7 +158,7 @@ Public Overrides Sub ReleaseConnections()
158158
End Sub
159159
```
160160

161-
### Validating the Component
161+
### Validating the component
162162
Destination component developers should perform validation as described in [Component Validation](../../integration-services/extending-packages-custom-objects/data-flow/validating-a-data-flow-component.md). In addition, they should verify that the data type properties of the columns defined in the component's input column collection match the columns at the external data source. At times, verifying the input columns against the external data source can be impossible or undesirable, such as when the component or the [!INCLUDE[ssIS](../../includes/ssis-md.md)] Designer is in a disconnected state, or when round trips to the server are not acceptable. In these situations, the columns in the input column collection can still be validated by using the <xref:Microsoft.SqlServer.Dts.Pipeline.Wrapper.IDTSInput100.ExternalMetadataColumnCollection%2A> of the input object.
163163

164164
This collection exists on both input and output objects and must be populated by the component developer from the columns at the external data source. This collection can be used to validate the input columns when the [!INCLUDE[ssIS](../../includes/ssis-md.md)] Designer is offline, when the component is disconnected, or when the <xref:Microsoft.SqlServer.Dts.Pipeline.Wrapper.IDTSComponentMetaData100.ValidateExternalMetadata%2A> property is **false**.
@@ -198,13 +198,13 @@ Private Sub AddExternalMetaDataColumn(ByVal input As IDTSInput100, ByVal inputCo
198198
End Sub
199199
```
200200

201-
## Run Time
201+
## Run time
202202
During execution, the destination component receives a call to the <xref:Microsoft.SqlServer.Dts.Pipeline.PipelineComponent.ProcessInput%2A> method each time a full <xref:Microsoft.SqlServer.Dts.Pipeline.PipelineBuffer> is available from the upstream component. This method is called repeatedly until there are no more buffers available and the <xref:Microsoft.SqlServer.Dts.Pipeline.PipelineBuffer.EndOfRowset%2A> property is **true**. During this method, destination components read columns and rows in the buffer, and add them to the external data source.
203203

204-
### Locating Columns in the Buffer
205-
The input buffer for a component contains all the columns defined in the output column collections of the components upstream from the component in the data flow. For example, if a source component provides three columns in its output, and the next component adds an additional output column, the buffer provided to the destination component contains four columns, even if the destination component will write only two columns.
204+
### Locating columns in the buffer
205+
The input buffer for a component contains all the columns defined in the output column collections of the components upstream from the component in the data flow. For example, if a source component provides three columns in its output, and the next component adds an additional output column, the buffer provided to the destination component contains four columns, even if the destination component writes only two columns.
206206

207-
The order of the columns in the input buffer is not defined by the index of the column in the input column collection of the destination component. Columns can be reliably located in a buffer row only by using the <xref:Microsoft.SqlServer.Dts.Pipeline.Wrapper.IDTSBufferManager100.FindColumnByLineageID%2A> method of the <xref:Microsoft.SqlServer.Dts.Pipeline.PipelineComponent.BufferManager%2A>. This method locates the column that has the specified lineage ID in the specified buffer, and returns its location in the row. The indexes of the input columns are typically located during the <xref:Microsoft.SqlServer.Dts.Pipeline.PipelineComponent.PreExecute%2A> method, and cached by the developer for use later during <xref:Microsoft.SqlServer.Dts.Pipeline.PipelineComponent.ProcessInput%2A>.
207+
The order of the columns in the input buffer isn't defined by the index of the column in the input column collection of the destination component. Columns can be reliably located in a buffer row only by using the <xref:Microsoft.SqlServer.Dts.Pipeline.Wrapper.IDTSBufferManager100.FindColumnByLineageID%2A> method of the <xref:Microsoft.SqlServer.Dts.Pipeline.PipelineComponent.BufferManager%2A>. This method locates the column that has the specified lineage ID in the specified buffer, and returns its location in the row. The indexes of the input columns are typically located during the <xref:Microsoft.SqlServer.Dts.Pipeline.PipelineComponent.PreExecute%2A> method, and cached by the developer for use later during <xref:Microsoft.SqlServer.Dts.Pipeline.PipelineComponent.ProcessInput%2A>.
208208

209209
The following code example finds the location of the input columns in the buffer during <xref:Microsoft.SqlServer.Dts.Pipeline.PipelineComponent.PreExecute%2A> and stores them in an array. The array is subsequently used during <xref:Microsoft.SqlServer.Dts.Pipeline.PipelineComponent.ProcessInput%2A> to read the values of the columns in the buffer.
210210

@@ -241,10 +241,10 @@ Public Overrides Sub PreExecute()
241241
End Sub
242242
```
243243

244-
### Processing Rows
244+
### Processing rows
245245
Once the input columns have been located in the buffer, they can be read and written to the external data source.
246246

247-
While the destination component writes rows to the external data source, you may want to update the "Rows read" or "BLOB bytes read" performance counters by calling the <xref:Microsoft.SqlServer.Dts.Pipeline.Wrapper.IDTSComponentMetaData100.IncrementPipelinePerfCounter%2A> method. For more information, see [Performance Counters](../../integration-services/performance/performance-counters.md).
247+
While the destination component writes rows to the external data source, you might want to update the "Rows read" or "BLOB bytes read" performance counters by calling the <xref:Microsoft.SqlServer.Dts.Pipeline.Wrapper.IDTSComponentMetaData100.IncrementPipelinePerfCounter%2A> method. For more information, see [Performance Counters](../../integration-services/performance/performance-counters.md).
248248

249249
The following example shows a component that reads rows from the buffer provided in <xref:Microsoft.SqlServer.Dts.Pipeline.PipelineComponent.ProcessInput%2A>. The indexes of the columns in the buffer were located during <xref:Microsoft.SqlServer.Dts.Pipeline.PipelineComponent.PreExecute%2A> in the preceding code example.
250250

@@ -282,7 +282,7 @@ End Sub
282282
```
283283

284284
## Sample
285-
The following sample shows a simple destination component that uses a File connection manager to save binary data from the data flow into files. This sample does not demonstrate all the methods and functionality discussed in this topic. It demonstrates the important methods that every custom destination component must override, but does not contain code for design-time validation.
285+
The following sample shows a simple destination component that uses a File connection manager to save binary data from the data flow into files. This sample doesn't demonstrate all the methods and functionality discussed in this topic. It demonstrates the important methods that every custom destination component must override, but doesn't contain code for design-time validation.
286286

287287
```csharp
288288
using System;
@@ -476,7 +476,7 @@ Namespace BlobDst
476476
End Namespace
477477
```
478478

479-
## See Also
479+
## Related content
480480
[Developing a Custom Source Component](../../integration-services/extending-packages-custom-objects-data-flow-types/developing-a-custom-source-component.md)
481481
[Creating a Destination with the Script Component](../../integration-services/extending-packages-scripting-data-flow-script-component-types/creating-a-destination-with-the-script-component.md)
482482

0 commit comments

Comments
 (0)