Udostępnij przez


Konstruktor ExecuteSQLTask

Inicjuje nowe wystąpienie ExecuteSQLTask klasy

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

Składnia

'Deklaracja
Public Sub New
'Użycie

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

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:SQLTask");
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.
// SQLTask myTask = th.InnerObject as SQLTask;
Dim pkg As Package =  New Package() 
Dim exec1 As Executable =  pkg.Executables.Add("STOCK:SQLTask") 
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 SQLTask =  th.InnerObject as SQLTask

Właściwości i metody ExecuteSQLTask są dostępne za pomocą TaskHost zmienną, th.

Przykłady

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

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