Udostępnij przez


Konstruktor SendMailTask

Inicjuje nowe wystąpienie SendMailTask klasy

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

Składnia

'Deklaracja
Public Sub New
'Użycie

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

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:SendMailTask");
TaskHost th = exec1 as TaskHost;
// You can cast the InnerObject of the TaskHost
// to the specific class.
// For the code samples, that task properties are accessed using
// the Properties of the TaskHost.
// SendMailTask myTask = th.InnerObject as SendMailTask;
Dim pkg As Package =  New Package() 
Dim exec1 As Executable =  pkg.Executables.Add("STOCK:SendMailTask") 
Dim th As TaskHost =  exec1 as TaskHost 
' You can cast the InnerObject of the TaskHost
' to the specific class.
' For the code samples, that task properties are accessed using
' the Properties of the TaskHost.
' Dim myTask As SendMailTask =  th.InnerObject as SendMailTask

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

Przykłady

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

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