SSIS script component C# code to load multiple column data into webservice url

  • We have written code in C# script component to load data to Organisation DB using Webservice url.

    Unable to code regarding the multiple columns data loading. Please find the below code.

    public override void PreExecute()

    {

    base.PreExecute();

    ClientCredentials credentials = new ClientCredentials();

    credentials.Windows.ClientCredential = System.Net.CredentialCache.DefaultNetworkCredentials;

    organizationservice = new OrganizationServiceProxy(

    new Uri("http://hsbcservices/DM/XRMServices/2011/Organization.svc"), null, credentials, null);

    }

    public override void PostExecute()

    {

    base.PostExecute();

    /*

    * Add your code here

    */

    }

    public override void Input0_ProcessInputRow(Input0Buffer Row)

    {

    string destinationEntity = "contact";

    string str = "";

    Entity newEntity = new Entity(destinationEntity);

    foreach (IDTSInputColumn100 column in ComponentMetaData.InputCollection[0].InputColumnCollection)

    {

    string strColumn = column.Name.ToLower();

    newEntity[strColumn] = ComponentMetaData.InputCollection[0].InputColumnCollection[column];

    str =str+ "; " + strColumn + ":" + newEntity[strColumn].ToString();

    }

    this.ReadWriteVariables["User::rowcolumn"].Value = str;

    Entity newcontact = new Entity("account");

  • Hi

    did the check the collection has required output coulmns with data

    if you explain your problem with addtional information it will be helfull

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply