Udostępnij przez


Konstruktor BulkInsertTask

Inicjuje nowe wystąpienie BulkInsertTask klasy

Przestrzeń nazw:  Microsoft.SqlServer.Dts.Tasks.BulkInsertTask
Zestaw:  Microsoft.SqlServer.BulkInsertTask (w Microsoft.SqlServer.BulkInsertTask.dll)

Składnia

'Deklaracja
Public Sub New
'Użycie

Dim instance As New BulkInsertTask()
public BulkInsertTask()
public:
BulkInsertTask()
new : unit -> BulkInsertTask
public function BulkInsertTask()

Uwagi

Przykładowy kod ilustruje wywołanie konstruktora zadania.Jednak w większości przypadków, który zostanie utworzony zadania jako element członkowski pakiet.Więcej informacji na temat rzutowanie zadania, patrz uwagi w Add.

Package pkg = new Package();
Executable exec1 = pkg.Executables.Add("STOCK:BulkInsertTask");
TaskHost th = exec1 as TaskHost;
// You can cast the InnerObject of the TaskHost
// to the specific class.
// For the code samples, the task properties are accessed by using
// the Properties collection of the TaskHost.
//BulkInsertTask myTask = th.InnerObject as BulkInsertTask;
Dim pkg As Package =  New Package() 
Dim exec1 As Executable =  pkg.Executables.Add("STOCK:BulkInsertTask") 
Dim th As TaskHost =  exec1 as TaskHost 
' You can cast the InnerObject of the TaskHost
' to the specific class.
' For the code samples, the task properties are accessed by using
' the Properties collection of the TaskHost.
' Dim myTask As BulkInsertTask =  th.InnerObject as BulkInsertTask

Właściwości i metody BulkInsertTask są dostępne przy użyciu TaskHost zmienną, th.

Przykłady

Poniższy przykładowy kod tworzy nową BulkInsertTask za pomocą konstruktora.

BulkInsertTask myTask = new BulkInsertTask();
Dim myTask As BulkInsertTask =  New BulkInsertTask()