Quantcast
Channel: Seneste spørgsmål - Eksperten - Computerworld
Viewing all articles
Browse latest Browse all 41446

Unable to cast COM oject of type 'System.__ComObject'

$
0
0
Hejsa!!

Jeg er ved at lave noget i et SSIS flow, men får en fejl og synes min kode er korrekt.

Trykker jeg properties på mit projekt står der den kører .net 2.0 framework - Jeg kan lave den om til 3.5 framework i stedet.

Men kigger jeg properties på min System.data siger den at det er version 2.0

using System.Text;
using System.Data.SqlClient;
using System;
using System.Data;
using System.IO;
using System.Windows.Forms;
using Microsoft.SqlServer.Dts.Pipeline.Wrapper;
using Microsoft.SqlServer.Dts.Runtime.Wrapper;


[Microsoft.SqlServer.Dts.Pipeline.SSISScriptComponentEntryPointAttribute]
public class ScriptMain : UserComponent
{

//Declare variables
private string PriceNvarchar;
private int EntryID;
SqlCommand sqlCmd;
SqlConnection sqlConn;
private string SQLDestinationTabel;
private string DestinationDatabase;
IDTSConnectionManager100 connMgr;

public override void AcquireConnections(object Transaction)
{

connMgr = this.Connections.Connection;
sqlConn = (SqlConnection)connMgr.AcquireConnection(null);


}
public override void PreExecute()
{
base.PreExecute();
/*
Add your code here for preprocessing or remove if not needed
*/
}

public override void PostExecute()
{
base.PostExecute();

// Set the Package Variable
Variables.PriceNvarchar = PriceNvarchar;
Variables.EntryID = EntryID;
Variables.SQLDestinationTabel = SQLDestinationTabel;
Variables.SQLDestinationDatabase = DestinationDatabase;
}

public override void Input0_ProcessInputRow(Input0Buffer Row)
{
sqlCmd = new SqlCommand("UPDATE RaptorData.Dbo.VildMedVinCleansedData SET Price ="+ @PriceNvarchar+" where EntryID = "+@EntryID);


}
public override void ReleaseConnections()
{

connMgr.ReleaseConnection(sqlConn);

}

}


Kan i hjælpe??

Viewing all articles
Browse latest Browse all 41446

Trending Articles


Sælges: Snell Type A reference (Højttalere)


Bølger


Kyubey (Puella Magi Madoka Magica)


Flandre Scarlet (Touhou)


Kaname Madoka (Puella Magi Madoka Magica)


Naruto Shippuden Episode 470 Subtitle Indonesia


Jav Uncensored - Tokyo-Hot n1002 Miyu Kitagawa


Dette er en opgave i Kemi C


DIY - Hæklet bil og flyvemaskine


Kotiya Sanae (Touhou)