0

I want to read the rows inside a user object, but when I try to fill it to a DataTable, Dts.Variables is not a recognized namespace.

public override void PreExecute()
{
    base.PreExecute();

    DataTable dt = new DataTable();
    OleDbDataAdapter adapter = new OleDbDataAdapter();
    adapter.Fill(dt, Dts.Variables["User::CRMDataSet"].Value);

    foreach (DataRow row in dt.Rows)
    {
        //insert what you want to do here
    }
}

The available namespaces are not related as well.

enter image description here

May I know how can I resolve this?

gymcode
  • 4,431
  • 15
  • 72
  • 128

1 Answers1

0

check on your variables that you have created and the scope is the right one: either package or the script task name. Also what is your data type: if you have table data then it should be object.

Example:

image variables

billinkc
  • 59,250
  • 9
  • 102
  • 159