Introduction
Data Trasformation Services (DTS) is a tool and set of programmable objects that lets you extract, trasform and consolidate data from various source into various destinations.
How to
Launch a DTS from Asp.net page is much useful, when you must import some data from disparate sources.
First, add reference Microsoft.SqlServer.ManagedDTS to project.
Place into the class the follow using:
using Microsoft.SqlServer.Dts.Runtime;
Now, into the page load event place this code:
string pkgLocation;
Package pkgImport;
Application appImport;
DTSExecResult pkgResults;
pkgLocation = @"c:\temp\DtsTest.dtsx";
appImport = new Application();
pkgImport = appImport.LoadPackage(pkgLocation, null);
pkgResults = pkgImport.Execute();
if (pkgResults == DTSExecResult.Success)
{
TxtEsito.text = "DTS Eseguito con successo.";
}
Also we can
Also, we can see the state of job using the follow state enumeration http://msdn2.microsoft.com/en-us/library/microsoft.sqlserver.dts.runtime.dtsexecresult.aspx