469,916 Members | 1,851 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,916 developers. It's quick & easy.

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 1114

This discussion thread is closed

Replies have been disabled for this discussion.

By using this site, you agree to our Privacy Policy and Terms of Use.