473,386 Members | 1,621 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

DTS.SendMailTask in VB.NET

Hi All,
I'm trying to use a mail message DTS in my project. I have got example in vb
6.0.

Dim objPackage As DTS.Package2
Dim objStep As DTS.Step
Dim objTask As DTS.Task
Dim objSendMail As DTS.SendMailTask
Set objStep = objPackage.Steps.New
Set objTask = objPackage.Tasks.New("DTSSendMailTask")
Set objSendMail = objTask.CustomTask
....
In VB.NET I try to write
Dim objPackage As DTS.Package2
Dim objStep As DTS.Step
Dim objTask As DTS.Task
Dim objSendMail As DTS.SendMailTask
objStep = objPackage.Steps.New
objTask = objPackage.Tasks.New("DTSSendMailTask")
objSendMail = objTask.CustomTask
...
and I get Error:
An unhandled exception of type 'System.InvalidCastException' occurred in
WindowsApplication3.exe
Additional information: QueryInterface for interface DTS.CustomTask
failed.

Does anyone have any help for this problem?

Best regards
Rysiek
Nov 21 '05 #1
0 1175

This thread has been closed and replies have been disabled. Please start a new discussion.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.