I have a package, inside which I have two components: First is a SQL task to execute and get an ADO result set, the second one is a script task, I convert the result set to System.Data.DataTable
twice, something like that:
System.Data.DataTable t1= new System.Data.DataTable();
OleDbDataAdapter adp = new OleDbDataAdapter();
adp.Fill(t1, Dts.Variables["ResultSet"].Value);
System.Data.DataTable t2= new System.Data.DataTable();
OleDbDataAdapter adp2 = new OleDbDataAdapter();
adp2.Fill(t2, Dts.Variables["ResultSet"].Value);
The result is t1 is correctly filled, but t2 remains empty; what's more, I have explicitly set [User::ResultSet]
as a read only variable, it seems the variable just become emptied, even I add one more script task later and do the same thing again, the filled DataTable
are still empty.
There are many ways to circumvent my case so I don't expect a solution here. But I want to get clarify those things: Does OleDbDataAdapter.Fill
have side effects to the original datasets, and how is my read-only variable changed its value?