SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Unable to cast COM object of type System.__ComObject to class type...


Unable to cast COM object of type System.__ComObject to class type System.Data.SqlClient.SqlConnection

Author
Message
M Shah
M Shah
Old Hand
Old Hand (379 reputation)Old Hand (379 reputation)Old Hand (379 reputation)Old Hand (379 reputation)Old Hand (379 reputation)Old Hand (379 reputation)Old Hand (379 reputation)Old Hand (379 reputation)

Group: General Forum Members
Points: 379 Visits: 51
I have a script task in the control flow where in I am connecting to the database (SQL Server 2005) and executing a SQL Statement. This was working, now when I try to change the package the script task fails with the following error:

Something Bad Happen 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.


The connection manager that I have created and I am using is a ADO .NET connection manager so that should not be the issue. Any inputs on resolving this will be much appreciated.

Thanks,

Monisha
sarang
sarang
SSC Rookie
SSC Rookie (45 reputation)SSC Rookie (45 reputation)SSC Rookie (45 reputation)SSC Rookie (45 reputation)SSC Rookie (45 reputation)SSC Rookie (45 reputation)SSC Rookie (45 reputation)SSC Rookie (45 reputation)

Group: General Forum Members
Points: 45 Visits: 113
Would be worth to check what service pack you have for SQL 2005, There were a few issues with SSIS 2005 and MS came out with a bunch of hot fixes for them in their service packs,
Could be found at -
http://support.microsoft.com/?id=955706

In addition,on the Script Task check for the PreCompile to be False if you are on Service Pack 1 or something.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search