SSIS: Exception has been thrown by the target of an invocation

I have a SSIS package to perform incremental processing of the cube. In the sequence container in this package, we have a script task to count the number of rows.

SSIS: Exception has been thrown by the target of an invocation

and the code in script task is as follows :

    public void Main()     {         string connectionString = "Data Source=localhost;PROVIDER=MSOLAP;Impersonation Level=Impersonate;Catalog=EcovaPlatform";         connectionString = connectionString.Replace("localhost", Dts.Variables["User::CubeServer1"].Value.ToString()).Replace("EcovaPlatform", Dts.Variables["User::CubeName1"].Value.ToString());          string queryString = "evaluate row(\"count\", countrows(BillDetail))";         AdomdConnection connection = new AdomdConnection(connectionString);          connection.Open();         AdomdCommand cmd = new AdomdCommand(queryString);         cmd.Connection = connection;         using (var reader = cmd.ExecuteReader())         {             while (reader.Read())             {                 Dts.Variables["CubeBillDetailRowCount1"].Value = Convert.ToInt64(reader[0]);             }         }         Dts.TaskResult = (int)ScriptResults.Success; 

But every once in a while, this script task(here I am assuming its the script task) fails. It throws out the following error:

Source Name: Cube Table RowCount Error Code: 1 Error Description: Exception has been thrown by the target of an invocation.

Now I dont know how to fix this issue. So I am turning to you good folks, to guide me in the right direction. If somebody wants to look at the XMLA script, I can post that as well. Thanks.


Category: sql Time: 2016-01-26 Views: 32

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development


Front-end development


development tools

Open Platform

Javascript development

.NET development

cloud computing


Copyright (C), All Rights Reserved.

processed in 0.225 (s). 12 q(s)