0

I have a variable assigned in my SSIS task. I want to access that variable inside a public static DataSet getDataSet() method in my Scriptmain.cs.

basically the variable has a connection string for my sql server and i need to get some values from a table and need to send those values as email in my script task.

Send a table in email

I tried to access it from the method public static Dataset however the keyword Dts is not recognized. I tried to find solution from the below link however the example states using the variable outside scriptmain and not inside a different method in script main

Use SSIS Variable in another class besides ScriptMain.cs

Can some one help me to access the dts variable inside a meathod inside scriptmain?

Community
  • 1
  • 1
Karthik Venkatraman
  • 1,619
  • 4
  • 25
  • 55
  • Having not seen the code I would assume you should be able to assign the dts variable to a string variable in the main and pass it into the method the same way you would any other variable. – SFrejofsky Oct 14 '15 at 12:20
  • Are you using a Script Task (Control Flow) or Script Component (Data Flow) to access your vars? You should have access `Dts.Variables` inside of all methods of the `ScriptMain` class in a *Script Task*. Script Component is another story... – sorrell Oct 14 '15 at 12:28
  • 1
    Questions about why code isn't working should include code – billinkc Oct 14 '15 at 13:09

0 Answers0