Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Analysis Server and Reporting Services (2008)
 Calling SSIS package from VS2010(C#)

Author  Topic 

StalinSubash
Starting Member

2 Posts

Posted - 2011-06-09 : 03:06:45
Hi,

I created a sample SSIS package, import data from csv file and store it into sql server 2008 db.if i execute the package alone it will execute.

If call via Visual Studio 2010, i got below error.

C# code:
--------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.SqlServer.Dts.Runtime;
using Microsoft.SqlServer.Dts.Runtime.Wrapper;

namespace SSISConsoleApps
{
class Program
{
static void Main(string[] args)
{
Application app = new Application();
Package package = app.LoadPackage(@"D:\Projects\SampleSSIS\SampleSSIS\Package2.dtsx",null);
DTSExecResult result = package.Execute();

}
}

Error:
------
Cannot implicitly convert type 'Microsoft.SqlServer.Dts.Runtime.Wrapper.IDTSPackage100' to 'Microsoft.SqlServer.Dts.Runtime.Wrapper.Package'.
An explicit conversion exists (are you missing a cast?)

Please advise me on this.

Thanks
Stalin.M

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2011-06-09 : 06:55:33
That sounds like you are using the COM wrapper. Remove that reference and use the managed assembly. It should be under .Net as Microsoft.SQLServer.ManagedDTS.
Go to Top of Page

tarunkanojia
Starting Member

1 Post

Posted - 2011-06-15 : 10:46:24
Its a hard to find assembly on my XP machine I found it the following location

C:\WINDOWS\assembly\GAC_MSIL\Microsoft.SqlServer.ManagedDTS\10.0.0.0__89845dcd8080cc91\Microsoft.SqlServer.ManagedDTS.dll
Go to Top of Page
   

- Advertisement -