c#SSIS错误二进制代码未找到

时间:2014-08-05 00:17:52

标签: c# visual-studio-2012 soap ssis sharepoint-2007

我在SSIS包中使用SOAP从sharepoint列表中获取行。该列表是2007年,因此我无法使用常规共享点连接器。

脚本说它成功构建但我有错误“找不到脚本的二进制代码。请打开脚本”....我已经通过这个和谷歌,我想我已经去了代码失明,我只是看不出我做错了什么......

代码如下:

>#region Namespaces
>using System;
>using System.Data;
>using System.Net;
>using System.Security;
>using System.Xml;
>using Microsoft.SqlServer.Dts.Pipeline.Wrapper;
>using Microsoft.SqlServer.Dts.Runtime.Wrapper;
>using SC_45b2900a2cc74c6b8d017e26b0213177.spSource;
>#endregion

 public override void CreateNewOutputRows()
{
    string userId = Variables.UserId;
    string passWord = Variables.PassWord;
    DateTime asOfDate = Variables.LastDate;

    SecureString encryptPassword = new SecureString();
    foreach (char c in passWord.ToCharArray())
    {
        encryptPassword.AppendChar(c);
    }

    const string LISTNAME = @"BPOS Dedicated";
   const string DateQuery = @"<Where>
                           <Or>
                               <Geq>
                                   <FieldRef Name='Created'/>
                                   <Value IncludeTimeValue='TRUE' Type='DateTime'>[LASTDATE]</Value>
                               </Geq>
                               <Geq>
                                   <FieldRef Name='Modified'/>
                                   <Value IncludeTimeValue='TRUE' Type='DateTime'>[LASTDATE]</Value>
                               </Geq>
                           </Or>
                       </Where>";
    System.Net.NetworkCredential netPass = new System.Net.NetworkCredential(userId, encryptPassword);

    SC_45b2900a2cc74c6b8d017e26b0213177.com.microsoft.msonline.Lists webRefSvc = new SC_45b2900a2cc74c6b8d017e26b0213177.com.microsoft.msonline.Lists();
    webRefSvc.Credentials = netPass;

    XmlDocument xmlDoc = new System.Xml.XmlDocument();

    XmlNode ndQuery = xmlDoc.CreateNode(XmlNodeType.Element, "Query", "");
    XmlNode ndViewFields = xmlDoc.CreateNode(XmlNodeType.Element, "ViewFields", "");
    XmlNode ndQueryOptions = xmlDoc.CreateNode(XmlNodeType.Element, "QueryOptions", "");

    ndQueryOptions.InnerXml = "<IncludeMandatoryColumns>FALSE</IncludeMandatoryColumns><DateInUtc>TRUE</DateInUtc>";
   ndViewFields.InnerXml = @"<FieldRef Name='ID' /> 
                            <FieldRef Name='Request Type' />";
    ndQuery.InnerXml = DateQuery.Replace("[LASTDATE]", asOfDate.ToString("s"));

    XmlNode ndListitems = webRefSvc.GetListItems(LISTNAME, null, ndQuery, ndViewFields, null, ndQueryOptions, null);

    foreach (XmlNode item in ndListitems)
    {
        RowBuffer.AddRow();

        int intConv = 0;

        if (item["ID"].Value != null)
        {
            string idString = item["ID"].Value.ToString();

            if (int.TryParse(idString, out intConv))
            {
                RowBuffer.ID = intConv;
            }
        }

        RowBuffer.RequestType = item["Request Type"].Value.ToString();

    }

    RowBuffer.SetEndOfRowset();
}

0 个答案:

没有答案