SSIS Skriptkomponente Verbindung

Ich habe die Suche nach einer Lösung nun seit Tagen und ich kann immer noch nicht scheinen, einen zu finden. Ich habe ein problem, erwerben Sie eine Verbindung in mein Script-Komponente. Ich brauche die Abfrage meiner Datenbank durch, um eine Id verwendet werden, bevor ich stecken Sie es in die

public override void AcquireConnections(object Transaction)
{
    connMgr = base.Connections.Connection;
    conn =  (SqlConnection)connMgr.AcquireConnection(null);
}

Bekomme ich hier eine Ausnahme.

System.InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to class type 'System.Data.SqlClient.SqlConnection'. Instances of types that represent COM components cannot be cast to types that do not represent COM components; however they can be cast to interfaces as long as the underlying COM component supports QueryInterface calls for the IID of the interface.

Irgendwelche Lösungen?

InformationsquelleAutor Milo Cabs | 2012-11-27
Schreibe einen Kommentar