Note that there are some explanatory texts on larger screens.

plurals
  1. POSSIS 2008 Script in C#: need to convert Y2K string to date format and use it to populate variable
    primarykey
    data
    text
    <p>I am trying to get records from an AS400 system into Dynamics CRM programatically. To achieve this i have pushed the AS400 records into a SQL table and am able to push those records to CRM by referencing the CRM 4 web service endpoints in a SSIS 2008 C# script.</p> <p>The problem is one of the fields is in Y2K date string format. In order to get it into a date field (D.O.B) in CRM i believe i will need to convert it to a date format then reference resulting value in a variable.</p> <p>I do not know how to do this.</p> <p>This question/answer (http://stackoverflow.com/a/4880021/1326443) may help with part of the question but i do not know how to use this into my script to get a value (haven't done any scripting for a number of years and new to C#)</p> <p>Script snippet:</p> <pre><code>public class ScriptMain : UserComponent { private CrmService service = null; public override void PreExecute() { base.PreExecute(); CrmAuthenticationToken token = new CrmAuthenticationToken(); token.AuthenticationType = 0; token.OrganizationName = "DevOrg"; service = new CrmService(); service.Url = "http://crm/mscrmservices/2007/crmservice.asmx"; service.CrmAuthenticationTokenValue = token; service.Credentials = System.Net.CredentialCache.DefaultCredentials; } public override void PostExecute() { base.PostExecute(); } public override void LeadInput_ProcessInputRow(LeadInputBuffer Row) { lead cont = new lead(); if (!Row.TITL20_IsNull) { cont.salutation = Row.TITL20; } if (!Row.DOBI20_IsNull) { cont.new_birthdate = Row.DOBI20; } .... .... service.Create(cont); } } } </code></pre> <hr> <p><code>{ cont.new_birthdate = Row.DOBI20; }</code> throws: </p> <blockquote> <p>cannot implicitly convert type 'string' to .....CrmSdk.CRMDateTime</p> </blockquote>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload