Error in executing SSIS package using mvc C# - ssis

I am working to run/execute SSIS package from my application developed in MVC 5.
The package is developed using Visual studio 2017 data tools.
I have written the following code to run the package
try
{
Application app = new Application();
Package package = null;
package = app.LoadPackage(#"‪C:\Users\EMISDb\Desktop\NEOC\EOC data need\NEOC_ETL\NEOC_ETL\99_Dash_WHO.dtsx", null);
//Excute Package
Microsoft.SqlServer.Dts.Runtime.DTSExecResult results = package.Execute();
if (results == Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure)
{
foreach (Microsoft.SqlServer.Dts.Runtime.DtsError local_DtsError in package.Errors)
{
Console.WriteLine("Package Execution results: {0}", local_DtsError.Description.ToString());
Console.WriteLine();
}
}
}
catch (DtsException ex)
{
throw;
}
but when i run, it gives the following error message. I tried to find 64 bit but could not find to install. Any help please.
**Retrieving the COM class factory for component with CLSID {4F0FC44B-C99C-441D-B86A-D60D7E22143D} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).**
and
**An Integration Services class cannot be found. Make sure that Integration Services is correctly installed on the computer that is running the application. Also, make sure that the 64-bit version of Integration Services is installed if you are running a 64-bit application.** '

Related

Microsoft.EntityFrameworkCore 2.1-rc with MySql.Data.EntityFrameworkCore

I'm trying to use mysql with Microsoft.EntityFrameworkCore 2.1-rc-final and MySql.Data.EntityFrameworkCore 8.0.11 as provider. But when I'm trying to execute the mugrations command i get this exception:
System.MissingMethodException: Method not found: 'Void Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommandBuilderFactory..ctor(Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger`1, Microsoft.EntityFrameworkCore.Storage.IRelationalTypeMapper)'.
This is my IDesignTimeDbContextFactory code implementation:
public class DesignLocationFactory:IDesignTimeDbContextFactory<LocationDbContext>
{
public LocationDbContext CreateDbContext(string[] args)
{
var builder = new DbContextOptionsBuilder<LocationDbContext>();
builder.UseMySQL("server=localhost;port=3306;user=***;passsword=***;database=locationdb");
return new LocationDbContext(builder.Options);
}
}
Please how can I fix this or at least some sample of how to use with another providers
Finally, with this provider Pomelo.EntityFrameworkCore.MySql version 2.1.0-rc1-final everything works perfect.
To install it execute the command:
Install-Package Pomelo.EntityFrameworkCore.MySql -Version 2.1.0-rc1-final
I can confirm that 2.1.0-rc1-final resolves this issue. Also, take note of Pomelo's case sensitivity vs Microsoft.EntityFrameworkCore.
Pomelo = UseMySql (Sql)
EntityFrameworkCore = UseMySQL (SQL)
Using Core 2.1
Id Versions
-- --------
Microsoft.AspNetCore.App {2.1.0}
Microsoft.VisualStudio.Web.CodeGeneration.Design {2.1.0}
Microsoft.EntityFrameworkCore.Tools {2.1.0}
Microsoft.NETCore.App {2.1.0}
MySql.Data.EntityFrameworkCore.Design {8.0.11}
MySql.Data.EntityFrameworkCore {8.0.11}
Pomelo.EntityFrameworkCore.MySql {2.1.0-rc1-final}

Unable to connect to ejabberd server using smack api

I am trying to connect to the ejabberd server and using Smack Api. Below is the code for connection to server. After setting username, Host, and localhost Service, i am trying to show a Toast whenever it is connected. On debugging, neither Toast is shown nor any exception... please have a look at code below
XMPPTCPConnectionConfiguration config = XMPPTCPConnectionConfiguration.builder()
.setUsernameAndPassword("alien#localhost", "alien")
.setServiceName("localhost")
.setHost("192.168.1.xx")
.setPort(5222)
.setDebuggerEnabled(true)
.build();
AbstractXMPPConnection conn2 = new XMPPTCPConnection(config);
try {
conn2.connect();
conn2.login();
if(conn2.isConnected())
{
Toast.makeText(ChatClient.this,"isConnected",Toast.LENGTH_LONG).show();
}
else
{
Toast.makeText(ChatClient.this,"Failed",Toast.LENGTH_LONG).show();
}
Following are dependencies which i have used in my project,
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.1.1'
compile "org.igniterealtime.smack:smack-android:4.1.0"
// Optional for XMPPTCPConnection
compile "org.igniterealtime.smack:smack-tcp:4.1.0"
// Optional for XMPP-IM (RFC 6121) support (Roster, Threaded Chats, …)
compile "org.igniterealtime.smack:smack-im:4.1.0"
// Optional for XMPP extensions support
compile "org.igniterealtime.smack:smack-android-extensions:4.1.0"
}
My domain is ( 192.168.***.2*:5280/admin )..thank you in advance :)

Stanford NLP ported to ikvm, FileLoad Exception

I'm trying to use the Stanford NLP tools ported to IKVM, but it gives me unhandeled exception.
here's the code I'm using
`string StanfordModelsDirectory = "englishPCFG.ser.gz";
try
{
LexicalizedParser LP = LexicalizedParser.loadModel(StanfordModelsDirectory);
TreebankLanguagePack tlp = new PennTreebankLanguagePack();
GrammaticalStructureFactory gsf = tlp.grammaticalStructureFactory();
Tree parse = LP.apply("what's the largest city in canada?");
parse.pennPrint();
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}`
I've referenced IKVM.OpenJDK.Core and stanford-parser, but the message
"Could not load file or assembly 'IKVM.OpenJDK.Core, Version=7.1.4532.2, Culture=neutral, PublicKeyToken=13235d27fcbfff58' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)" appears.
I'm using windows 8 (visual studio 2012, .NET 4.5)
IKVM is compiled for .NET 2.0. You need to add a config file to your application to map to a different .NET version like 4.5.
IKVM 7.2.x contains such config file for ikvm.exe, ikvmc.exe, .....

How to get detailed error from CLR Stored Procedure called in DTC transaction from SSIS Package

Whenever an exception is thrown in CLR stored procedure called from a SSIS package, within a DTC transaction , the error returned to client (SSIS package) relates to DTC rather than the underlying exception.
Is it possible to have information for the underlying error returned to client?
Note: When stored procedure is run from SQL Server Management Studio, outside of distributed transaction, detailed information for underlying error is returned.
Error: Executing the query "StoredProcedure” failed with the following
error: “The Microsoft Distributed Transaction Coordinator (MS DTC) has
cancelled the distributed transaction”. Possible reasons: Problems
with the query, “ResultSet” property not set correctly, parameters not
set correctly, or connection not established correctly.
All code running on a single SQL Server 2008 instance.
SSIS Package
---> Sequence Container (TransactionOption = Required )
---> Execute SQL Task (ADO.NET Connection Manager, SQLClient DataProvider)
---> SQL Server CLR Stored Procedure (No exception handling code)
---> TransactionScope(TransactionScopeOption.Required)
Code Which Reproduces Issue
The following code illustrates the issue but differs from the scenario described in the title in that client is a C# console app rather than a SSIS package
CLR Stored Procedure
using System;
using System.Transactions;
public partial class StoredProcedures
{
[Microsoft.SqlServer.Server.SqlProcedure]
public static void ExceptionStoredProcedure()
{
using (TransactionScope scope = new TransactionScope())
{
throw new Exception(#"Test exception thrown from ""ExceptionStoredProcedure""");
}
}
};
C# Console App Client
using System;
using System.Data.SqlClient;
using System.Transactions;
namespace SQLCLRTester
{
class Program
{
static void Main(string[] args)
{
try
{
using (TransactionScope scope = new TransactionScope())
{
string connectionString = "Data Source=.; Initial Catalog=Experiments; Integrated Security=Yes";
using (SqlConnection noOpConnection = new SqlConnection(connectionString))
{
noOpConnection.Open();
using (SqlConnection connection = new SqlConnection(connectionString))
{
SqlCommand command =
new SqlCommand()
{
CommandText = "ExceptionStoredProcedure",
CommandType = System.Data.CommandType.StoredProcedure,
Connection = connection
};
connection.Open();
command.ExecuteNonQuery();
}
} scope.Complete();
}
}
catch (Exception ex)
{
Console.WriteLine("Exception caught: {0}", ex.Message);
}
}
}
}
Message Printed By Client
Exception caught: The Microsoft Distributed Transaction Coordinator (MS DTC) has cancelled the distributed transaction
Notes:
InnerException is null
If the transaction scope in either the C#
console app or in the CLR stored procedure is removed then a DTC
transaction is not created and the information for underlying error
is returned .
Found a workaround that uses SqlContext.Pipe.Send() thanks to links provided by
Bob Beauchemin (Partner, MVP). See code below.
Notes: SqlClient appends "information messages" sent by SQL Server to SqlException.Message so client code that uses SqlClient doesn't need to change
CLR Stored Procedure
using System;
using System.Transactions;
using Microsoft.SqlServer.Server;
using System.Data.SqlClient;
public partial class StoredProcedures
{
[Microsoft.SqlServer.Server.SqlProcedure]
public static void ExceptionStoredProcedure()
{
using (TransactionScope scope = new TransactionScope())
{
try
{
throw new Exception(#"Test exception thrown from ""ExceptionStoredProcedure""");
scope.Complete();
}
catch (Exception ex)
{
if (Transaction.Current.TransactionInformation.DistributedIdentifier != Guid.Empty)
SqlContext.Pipe.Send(ex.Message);
throw;
}
}
}
};
Message Printed By Client
Exception caught: The Microsoft Distributed Transaction Coordinator (MS DTC) has cancelled the distributed transaction.
Test exception thrown from "ExceptionStoredProcedure"
Possible Explanation
Based on article links found by Bob about DTC transaction abort and T-SQL TRY/CATCH I think the observed behaviour may unfold as follows:
Exception in transaction scope in CLR stored procedure causes a
transaction abort vote to be sent to DTC.
DTC sends an abort request to all enlisted resource managers
including SQL Server
SQL Server translates abort request into an attention signal to the
SQL Server session in which the CLR stored procedure is executing
Attention signal changes how SQL Server CLR hosting code treats with
unhandled CLR exception which in turn results in exception message
not being included in result returned to client
Links to articles:
http://connect.microsoft.com/SQLServer/feedback/details/414969/uncatchable-error-when-distributed-transaction-is-aborted
http://msdn.microsoft.com/en-us/library/ms179296(SQL.90).aspx

Problem in executing SSIS Package through an asp.net c# application

i am having a problem in executing the SSIS package through an asp.net application. i'm using c#. every time i run the package through web, i think the package is not disposed properly so until and unless i stop the application the package won't execute...i am not able to dispose or unload the package...
i'm geeting errors like
'WebDev.WebServer.EXE' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_32\CustomMarshalers\2.0.0.0__b03f5f7f11d50a3a\CustomMarshalers.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
The result of the expression ""EXEC " + #[User::vRowData]" on property "SqlStatementSource" cannot be written to the property. The expression was evaluated, but cannot be set on the property.
: Package Execution results: {0}
here is my code
Application app = new Application();
//Package package = app.LoadPackage("D:\ChipRewards_WorkingFolder\ChipRewards\Codebase\HeathPlan\Common\Trunk\SSIS Package\ETL_WorkFlow\ETL_WorkFlow\DataImport.dtsx", null);
//package.ImportConfigurationFile("D:\ChipRewards_WorkingFolder\ChipRewards\Codebase\HeathPlan\Common\Trunk\SSIS Package\ETL_WorkFlow\ETL_WorkFlow\ETLConfig.dtsConfig");
using (Package package = app.LoadPackage("D:\\ChipRewards_Test_Environment\\Test\\ETL_WorkFlow\\ETL_WorkFlow\\DataImport.dtsx", null, true))
{
package.ImportConfigurationFile("D:\\ChipRewards_Test_Environment\\Test\\ETL_WorkFlow\\ETL_WorkFlow\\ETLConfig.dtsConfig");
DTSExecResult result = package.Execute();
if (result == Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure)
{
foreach (Microsoft.SqlServer.Dts.Runtime.DtsError local_DtsError in package.Errors)
{
Debug.WriteLine("Package Execution results: {0}", local_DtsError.Description.ToString());
}
}
package.Dispose();
}
i don't know what's happening...i would be very thankful if anyone could help me solve the problem...
Thanks,
Antiflag
Looking at this bit:-
The result of the expression ""EXEC " + #[User::vRowData]" on property "SqlStatementSource" cannot be written to the property.
It sounds like there is a problem with the configuration file and an expression you are trying to load.