I have made web application and wcf service. from web api, user can select csv file and in wcf service i want to do code for execute the package.
can anyone suggest me code for executing package using dtexec.exe in command line?
if I write "C:\Program Files\Microsoft SQL Server\100\DTS\Binn\dtexec.exe" /F "D:\CloudAmber\Icarus\CloudAmber.DataWarehouse\Harshal\testRecordCount\testRecordCount\Package.dtsx" in command prompt then it works.
but how to pass it to command prompt from c# code?
Normally one should be able to use the Process class in the System.Diagnostics namespace. The Process.Start method is overloaded with a number of paramters - there is a decent tutorial here: http://www.dotnetperls.com/process-start However, I didn't quite understand your architecture, so if you are unable to invoke Process class on the host system this may not work for you.
There is also a Package class. What you want to look for are Microsoft.SqlServer.Dts.Runtime.Application.LoadPackage and Package.execute.
I already tried with that. I passed the command which I mentioned above in process.start but it does not work. Let me know that is there any way by which I can execute above command in command prompt?
quote:Originally posted by James K
Normally one should be able to use the Process class in the System.Diagnostics namespace. The Process.Start method is overloaded with a number of paramters - there is a decent tutorial here: http://www.dotnetperls.com/process-start However, I didn't quite understand your architecture, so if you are unable to invoke Process class on the host system this may not work for you.
There is also a Package class. What you want to look for are Microsoft.SqlServer.Dts.Runtime.Application.LoadPackage and Package.execute.
The other option that I can think of is what I had mentioned about the Package class. At the bare minimum, you would load the package using Application.LoadPackage and then run that package using the Execute method of the Package class.