3 methods for adding records using AO [reprinted]

Source: Internet
Author: User
3 methods for adding records using AO [reprinted]
Http://www.ggiiss.com/gis/59/482.html

When adding records to table and featureclass, there are several optional insert methods.
They have different efficiency in different use environments ......
Process description
-------------
1 Store Method
Store using irow and ifeature
The createrow () createfeature () method of itable or ifeatureclass first creates an object and calls store
This method is relatively low in various environments, but the obtained information is relatively most suitable for data objects generated by UI interaction.
A) Perform a database access at createrow () [insert]
B) after creation, the oId value is returned in the row.
C) Call store after assigning values to other fields for the second database access [updata]. In this case, the onchange and other event calls of the row object are triggered.
--------------
2 writerow Method
Use itablewrite. writerow () or ifeatureclasswrite. writefeature ()
The createrow () createfeature () method of the itable or ifeatureclass first creates an object.
Call itable. writerow () or ifeatureclass. writefeature () after the assignment ()
The difference between calling itablewrite and other underlying interfaces is that the corresponding event is not triggered when data is written.
Writing geometric network layer data faster without affecting the network topology of Objects
A) Perform a database access at createrow () [insert]
B) after creation, the oId value is returned in the row.
C. Call store to access the database for the second time [updata] After assigning values to other fields. This does not trigger events.

-----------------
3 insert Buffer
Use itable. createrowbuffer () or ifeatureclass. createfeaturebuffer () to create a memory object
Ifeaturecursor. insertfeature () writes data to the database only once, which is faster but the memory object is before writing
Oid =-1 is applicable to simple elements of batch writing.
A) create a memory object in createrowbuffer ()
B) after creation, oId =-1 is already in row.
C. Call icursor. insert () to insert a database after assigning values to other fields.

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.