Increase the Execution time or Connection Time out property of SSIS package from C# code
-
Hi, I have a Console Application that is executing an SSIS package, as the SSIS package is taking too long to execute either I want to set time out property max or more execution time. Currently I am using RetainSameConnection to true on Connection, but if I can set Time out property that would be better either for the Execution or Connection, anything is good. Can anybody please help me in that regards? Any help either code snippet, a link or even a suggestion would be very helpful - thanks in advance. Here is my code: For loading and executing SSIS Pakcage I am using a class
public class DTSPackage
{
private string _PkgLocation;
private DTSPackageStatus _Status;
private Package _Pkg;
private Microsoft.SqlServer.Dts.Runtime.Application _app;public string PkgLocation { get { return \_PkgLocation; } } public DTSPackageStatus PackageStatus { get { return \_Status; } } public string SsisPackageToBeLoadedFrom { get; set; } public DTSPackage() { \_PkgLocation = null; \_Status = DTSPackageStatus.Empty; \_Pkg = null; \_app = new Microsoft.SqlServer.Dts.Runtime.Application(); } private void DisposePackage() { try { if (\_Pkg != null) { \_Pkg.Dispose(); \_Pkg = null; } } catch (Exception ex) { \_Status = DTSPackageStatus.LoadFailed; } } public void ClearPackage() { \_PkgLocation = null; \_Status = DTSPackageStatus.Empty; DisposePackage(); } public void LoadPackage(string SsisPackageToBeLoadedFrom = "File System", string PackageName = "", string TargetServer = "WSQL569S,50101", string PackFileSystemLocation = "", string PkgMSDBLocation = "", string SSISPackageStoreLocation = "") { /\*PkgLocation = PkgLocation;\*/ \_Pkg = null; \_PkgLocation = null; //if (PkgLocation != null) //{ DisposePackage(); try { string packageFullPhysicalPath = Path.Combine(PackFileSystemLocation, PackageName); if (String.IsNullOrEmpty(Path.GetExtension(PkgLocation))) {