尝试从SharePoint页面下载文件时出现错误

时间:2019-04-10 21:25:41

标签: c# sql-server sharepoint ssis

我正在SSIS中执行脚本任务以连接到Sharepoint网页并从那里下载文件。该脚本在C#中,并且正在执行。

执行它时,出现错误:

  

Microsoft.SqlServer.ManagedDTS.dll中发生类型'System.NullReferenceException'的异常,但未在用户代码中处理

     

其他信息:对象引用未设置为对象的实例。

这是什么意思?

string FilePath = Dts.Variables["User::FilePath"].Value.ToString();
object obj = Dts.Connections["HTTP Connection Manager 1"].AcquireConnection(null);
HttpClientConnection HTTPConnection = new HttpClientConnection(obj);
HTTPConnection.DownloadFile(FilePath, true);


Dts.TaskResult = (int)ScriptResults.Success;

0 个答案:

没有答案