1

I am trying to load an XML file in an SSIS Script task.
This works:

var fullpath = "E:/perforce_ws/EnterpriseTrunk/SSIS/Inbox/RCT_Import_1.xml";  
var xml = XDocument.Load(fullpath); 

But this doesn't:

var fullpath = Dts.Variables["XMLFullPath"].Value.ToString;  
var xml = XDocument.Load(fullpath);  

The error being returned is

"Cannot assign method group to an implicitly-typed variable".

Where have I gone wrong?

n4m31ess_c0d3r
  • 3,028
  • 5
  • 26
  • 35
Matthew Nelson
  • 105
  • 1
  • 8

1 Answers1

1

ToString is a method group.

ToString() is a method call.

The assignment code you were looking for is

var fullpath = Dts.Variables["XMLFullPath"].Value.ToString();
billinkc
  • 59,250
  • 9
  • 102
  • 159