• CozyRoc (11/20/2009)


    Strick,

    The adapter you are using is just an adapter. It takes ADO recordset and populates .NET data set. This is making your memory consumption at least twice as much because you now have a copy of the data in both ADO recordset and the dataset.

    From the approach you are using there are actually two solutions I could think of:

    1. Store the data table you get from OleDbDataAdapter in package variable and use this managed data set in the 3rd data flow. I would recommend you dispose/release the recordset object after you load the data in the adapter. It is not needed.

    2. Avoid using managed data set entirely. Use the ADO recordset directly. To do this you have to include reference to adodb library in your project. Then you have to include the following import:

    Imports ADODB

    and use the following code:

    Dim rs As Recordset = CType(Me.Variables.rsPayeeSummary, Recordset)

    and now you will have the familiar ADO Recordset in the rs variable and you can use your previous skills to pull the data from it 😉

    Hi CozyRoc,

    Interesting stuff. I like #1 as when I made the switch from VB6 to .NET back in 2003 I vowed never to go back unless a project called specifically for VB6. 🙂 So with that said, is it ok to load the datatable from the data adapter and then release the recordset by just setting it = to the data table?

    Something like:

    Dim dt As DataTable = New DataTable

    Dim da As OleDbDataAdapter = New OleDbDataAdapter

    da.Fill(dt, Me.Variables.rsPayeeSummary)

    Me.Variables.rsPayeeSummary = dt

    'release objects

    dt = nothing

    da = nothing

    Also, if there is a way in which I can load the recordset as a .NET (instead of ADO)one in the first dataflow task, I could do that as well.

    Thanks!

    Strick