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

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 41338

Trending Articles


Grand galla med gull og glitter


Psykiater Tonny Westergaard


Jav Uncensored - Tokyo-Hot n1002 Miyu Kitagawa


Moriya Suwako (Touhou)


BRODERET KLOKKESTRENG MED ORDSPROG 14 X 135 CM.


Naruto Shippuden Episode 471 Subtitle Indonesia


Fin gl. teske i sølv - 2 tårnet - stemplet


Kaffefilterholder fra Knabstrup


Anders Agger i Herstedvester


Onkel Joakims Lykkemønt *3 stk* *** Perfekt Stand ***


Sælges: Coral Beta/Flat (Højttaler-enheder)


Starwars landspeeder 7110


NMB48 – Durian Shounen (Dance Version) [2015.07.15]


Le bonheur | question de l'autre


Scope.dk som agent?


Akemi Homura & Kaname Madoka (Puella Magi Madoka Magica)


Tidemands taffel-marmelade julen1934+julen 1937+julen 1938.


Re: KZUBR MIG/MMA 300 zamena tranzistora


Analyse 0 mundtlig eksamen


DIY - Hæklet bil og flyvemaskine