0
    using System;
    using System.Data;
    using Microsoft.SqlServer.Dts.Runtime;
    using System.Windows.Forms;
    using System.IO;
    using System.Data.OleDb; 

     public void Main()
            {
                OleDbConnection objConnection = null;
                string strConnection= string.Empty; 
                try
                {
                    string[] sourcefiles = Directory.GetFiles(Dts.Variables["User::FilePath"].Value.ToString());
                    string strFileQualifiedName = Convert.ToString(Dts.Variables["User::FilePath"].Value)
                                         + "\\" + Convert.ToString(Dts.Variables["User::FileName"].Value);

                    //Provider for excel 2007
                     strConnection = "Provider=Microsoft.ACE.OLEDB.12.0;" + "Data Source=" + strFileQualifiedName + ";Extended Properties=\"Excel 12.0 XML;HDR=NO\"";              

                    if (Directory.Exists(Convert.ToString(Dts.Variables["User::FilePath"].Value)))
                    {
                        FileInfo fileInfo = new FileInfo(strFileQualifiedName);
                        if (fileInfo.Exists)
                        { 
                 // I think it fails in the next line
                            objConnection = new OleDbConnection(strConnection); 
                            objConnection.Open();
                            DataRow[] drWorkSheets = objConnection.GetSchema("Tables").Select("TABLE_NAME = '" + Convert.ToString(Dts.Variables["User::WorkSheetName"].Value).Trim() + "$'");
                            if (drWorkSheets.Length == 1)
                            {
                                Dts.Variables["User::IsWorkSheetFound"].Value = true;
                            }
                            else
                            {
                                Dts.Variables["User::IsWorkSheetFound"].Value = false;
                            }
                            objConnection.Close();
                        }
                        else
                        {
                            Dts.Variables["User::IsWorkSheetFound"].Value = false;
                        }
                    }
                    else
                    {
                        Dts.Variables["User::IsWorkSheetFound"].Value = false;
                    }

                    Dts.TaskResult = (int)ScriptResults.Success;
                }
                catch (Exception ex)
                {
                    Dts.TaskResult = (int)ScriptResults.Failure;
                    Dts.Variables["User::StatusDescription"].Value = "Check Work Sheet Error: " + ex.Message + "Stack Trace: " + ex.StackTrace + "Connection string: " + strConnection;
                }
                finally
                {
                    if (objConnection != null)
                    {
                        if (objConnection.State == ConnectionState.Open)
                        {
                            objConnection.Close();
                        }
                        objConnection.Dispose();
                        objConnection = null;
                    }
                }
            }
        }
    }

Stake Trace : Stack Trace:at System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection) at System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject) at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup, DbConnectionOptions userOptions) at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource1 retry, DbConnectionOptions userOptions) at System.Data.ProviderBase.DbConnectionInternal.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) at System.Data.OleDb.OleDbConnection.Open() at ST_a451219206e54e21b4be51b95b706a1b.csproj.ScriptMain.Main()Connection string: Provider=Microsoft.ACE.OLEDB.12.0;Data Source=\RRWIN-FSSSISE01\File\SSISData\LoadFiles\Import\TrialBalanceDef_08afd8dc-38b7-4ea5-80c3-8b7e7ce383b5\0552d0b9-8abe-4b3f-9b7b-43e47c1d2108TrialBalanceDefinitionImport.xlsx;Extended Properties="Excel 12.0 XML;HDR=NO"

How i resolve it most of the time I restart the app Server by going to the Task Manager enter image description here

As it only happen in The Stage and Production environment. If i take the backup of DB and work in DEV Or QA there is not issue. Restarting the Service only works; Eventhough, the Memory consumption of the Service is not Overloaded it is only consuming about 30-35 percentage of memory. Please let me know any idea you might have i will greatly appreciate it . Thank you.

Together with Error Message

SISServiceBiz.RunPackage called: package name = WorkbookDefinitionsImport.dtsx ERROR: Data Processor Failed. Error Message: Check Work Sheet Error: System resource exceeded.Stack Trace: at System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection) at System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject) at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup, DbConnectionOptions userOptions) at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource1 retry, DbConnectionOptions userOptions) at System.Data.ProviderBase.DbConnectionInternal.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) at System.Data.OleDb.OleDbConnection.Open()

user3920526
  • 404
  • 4
  • 20
  • What is the error? – Tab Alleman Oct 23 '17 at 13:41
  • Were security patched applied recently? You might want to monitor this thread. https://stackoverflow.com/questions/46903444/ssis-2008-r2-excel-connection-manager-failed-with-error-code-0xc0202009 – fchukoskie Oct 25 '17 at 12:38
  • I will ask the deployment team about that. – user3920526 Oct 26 '17 at 17:11
  • @Tab Alleman , i have updated the question with the Error message it gets the most intriguing part of the message is, System resource exceeded. – user3920526 Oct 26 '17 at 17:20
  • That means you don't have enough memory, disk space, or some other system resource. https://www.google.com/search?q=ssis+system+resource+exceeded&oq=ssis+system+reso&aqs=chrome.0.0j69i57.3031j0j8&sourceid=chrome&ie=UTF-8 – Tab Alleman Oct 26 '17 at 19:20

0 Answers0