web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

SSIS Script Task - Connect to D365 using KingswaySoft.DynamicsCRMServices.dll

(0) ShareShare
ReportReport
Posted on by 325

Hi All,

I am trying to connect to D365 using Script Task but I'm having this kind of error

This is the blog I followed. Any ideas?

*This post is locked for comments

I have the same question (0)
  • KingswaySoft Profile Picture
    545 on at

    We're not able to see the error you are receiving. Could you re-paste it or send an email directly to our support team - support@kingswaysoft.com - so we may take a closer look?

    Thank you,

    KingswaySoft

  • Aric Levin - MVP Profile Picture
    30,190 Moderator on at

    Please post the error or fix screenshot so we can see what the error is?

  • PDCM Profile Picture
    325 on at

    Hi,

    Thanks for your reply.

    This is my code:

    var connMgr = (CrmConnection)this.Dts.Connections["Database"].AcquireConnection(null);

    and this is my error:

    Unable to cast COM object of type 'System.__ComObject' to class type 'KingswaySoft.IntegrationToolkit.DynamicsCrm.CrmConnection'. 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.

  • Daniel Cai Profile Picture
    935 on at

    Can you please confirm your CRM connection manager's name is indeed "Database" (which doesn't really make sense)? 

  • PDCM Profile Picture
    325 on at

    Hi Daniel,

    Thanks for your correction. This is the actual error and code.

    Code:

    var connMgr = (CrmConnection)this.Dts.Connections["DynamicsCRM"].AcquireConnection(null);

    Error:

    Unable to cast object of type 'System.String' to type 'KingswaySoft.IntegrationToolkit.DynamicsCrm.CrmConnection'.

  • Verified answer
    Daniel Cai Profile Picture
    935 on at

    I would suggest you refer back to bullet point #12 in the blog post again. The way that you are doing is for a version prior to our v7 release, which I don't think is the version that you are using.

  • PDCM Profile Picture
    325 on at

    Hi Daniel,

    I followed this blog and you're correct, I'm using the wrong script. Thank you very much.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans