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. |