The Int fill (INT startrecord, int maxrecords, Params datatable [] datatables) method of dataadapter

Source: Internet
Author: User
In fact, if the paging does not require high performance, you can use
Dataadapter. Fill (INT startrecord, int maxrecords, Params datatable [] datatables) Method

The principle is while (0 <startrecord)
{
If (! Container1.read ())
{
Return 0;
}
Startrecord --;
}
Int num1 = 0;
If (0 <maxrecords)
{
While (num1 <maxrecords) & container1.read ())
{
If (this. _ hasfillerrorhandler)
{
Try
{
Mapping. loaddatarowwithclear ();
Num1 ++;
}
Catch (exception exception1)
{
If (! ADP. iscatchableexceptiontype (exception1 ))
{
Throw;
}
ADP. traceexceptionforcapture (exception1 );
This. onfillerrorhandler (exception1, mapping. able, mapping. datavalues );
}
Continue;
}
Mapping. loaddatarow ();
Num1 ++;
}
Return num1;
}

This is the code from reflector. We can see that it uses datareader. Read to specify the number of rows.
The read method does not consume much time. If the access speed requirement is not extremely demanding,
This method is completely usable.
This will not cause the returned able or dataset to be too large.
In fact, even a few of the thousands of pieces of data have patience.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.