GetRows method


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: GetRows method

Hybrid View

  1. #1
    Jason West Guest

    GetRows method


    Greetings,

    I am using an SQLServer DB with 1 million or more records to process. I want
    to get only a batch of records to process at a time. Apparently the GetRows
    method would be the appropriate method to use to do this. What I don't understand
    is the following: 1)If I want to get all the fields, how do I do this with
    the Fields parameter? 2)If I use this method will the rest of my code for
    interfacing with the recordset to assign values to the fields work the same?
    3)If I use this method, I only want to update the actual database when I
    am finished processing the batch. Should I use the UpdateBatch method after
    completion of processing all the records in the batch? Should I not use the
    Update method after assigning new values to the fields in the Recordset that
    I have aquired with the GetRows method?

    Thanks for any help,
    Jason

  2. #2
    Jason Guest

    Re: GetRows method


    "Jason West" <jvwest@northstate.net> wrote:
    >
    >Greetings,
    >
    >I am using an SQLServer DB with 1 million or more records to process. I

    want
    >to get only a batch of records to process at a time. Apparently the GetRows
    >method would be the appropriate method to use to do this. What I don't understand
    >is the following: 1)If I want to get all the fields, how do I do this with
    >the Fields parameter? 2)If I use this method will the rest of my code for
    >interfacing with the recordset to assign values to the fields work the same?
    >3)If I use this method, I only want to update the actual database when I
    >am finished processing the batch. Should I use the UpdateBatch method after
    >completion of processing all the records in the batch? Should I not use

    the
    >Update method after assigning new values to the fields in the Recordset

    that
    >I have aquired with the GetRows method?
    >
    >Thanks for any help,
    >Jason


    Jason,

    I don't think you'd want to use the GetRows method in this case. It sounds
    like you want to update the 1 million records in the database. GetRows is
    more for extracting the rows out into an array and doing some form of transformation
    on them. Yes you should think about using the UpdateBatch method using a
    client-side cursor. If you are using a BatchOptimistic update mode, calling
    the recordset Update method will not send data to the database, instead it
    just puts the values into the recordset (it's not really necessary). You'd
    definitely want to break your processing up into a number of chunks.

    Hope this helps!

    Jason

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center