Using this inside an SSIS script component. I just used the example above that included a β#β around dates. I also converted each to a string. This worked great.
Just in case, you want to know how I configure it inside SSIS: First there was a data stream using the destination of the recordset with the variable Object to store the recordset.
in my script, I included the variable as read-only.
In the main class ...
public class ScriptMain : UserComponent { OleDbDataAdapter a = new OleDbDataAdapter(); System.Data.DataTable AwardedVacTable = new System.Data.DataTable(); ... ...
then in Pre-Execute ...
public override void PreExecute() { base.PreExecute(); a.Fill(AwardedVacTable, Variables.rsAwardedVac); ... ...
then in the user method datatable data access ...
String dtFilter = "EmployeeID = " + empId.ToString() + " AND (#" + Convert.ToString(StartDate) "# <= EndDate AND #" + Convert.ToString(StartDate) + "# >= StartDate" + " OR #" + Convert.ToString(StartDate.AddDays((double)numDays)) + "# >= StartDate AND #" + Convert.ToString(StartDate.AddDays((double)numDays)) + "# <= EndDate)"; DataRow[] Overlaps = AwardedVacTable.Select(dtFilter);
source share