Online Documentation for Advanced Data Export .NET



public virtual void Execute()



The  Execute method is the central method of the collection. It executes the export of source data to file. Of course, for each descendant class the method is defined in its own way, but the logics of the work remains the same for all the components. In case of the invocation, the function checks if the FileName and ExportSource (and the corresponding Command, DataTable or ListView) properties are correct; in case of an error, the exceptions are raised and the method stops executing, returning false as a result. If all the required properties are set correctly, the method starts its work with generating the BeginExport event. Then the data export to file begins, and after the export of each record the event ExportedRecord event takes place. On completion of the process, the event EndExport is invoked. The export can be interrupted by Abort method invocation, in this case the StopExport event handler is invoked. At the same time, it is guaranteed that even in case of export interruption the output file will still exist in a readable form for the corresponding software product.