s.weiser

s.weiser

  • NA
  • 3
  • 0

DTS package in C#

Jul 7 2004 3:10 AM
I'm creating a C# application that will be used to transfer tables and data from one database to another, and I'm stuck with an invalid cast exception at the moment on the line of code where I try to cast a transfer objects task into a custom task like so: oCustomTask1 = (TransferObjectsTask2)oTask.CustomTask; here's the code in a little more context: DTS.Package2Class oPackage; ... Task oTask; TransferObjectsTask2 oCustomTask1; oTask = ContentPackage.Tasks.New("DTSTransferObjectsTask"); oCustomTask1 = (TransferObjectsTask2)oTask.CustomTask; oCustomTask1.Name = "DTSTask_DTSTransferObjectsTask_1"; ... oCustomTask1.AddObjectForTransfer(... ... oPackage.Tasks.Add(oTask); HELP! Anyone solved this problem yet?!

Answers (2)