Save method can be used to synchronize any changes made to this object or its related objects. If the current ObjectState is set to Disconnected, calling Save method will change the object state to "Connected" and the Save method will attempt to send all inserts/updates/deletes locally held to the database.
Save method also tries to save any of the related/joined object's locally held changes. If the UseTransaction property is set to true, any records failure will cause the transaction to be rolled back. If all records/changes have been saved correctly without any errors/exceptions then the transaction will be automatically committed. If however the UseTransaction property is set to false then the ErrorString property will be populated with errors for each row that failed.
| C# | |
|---|---|
public virtual bool Save() | |
Return Value
Returns a true value if all the changes were saved successfully. If the UseTransaction is set to true and any errors are encountered during the Save process the business object will automatically RollBack the transaction and return false. If UseTransaction is set to false, any errors that occur will be marked in each DataRow's RowError property, and the rest of the rows/changes will continue to be saved.Target Platforms: .NET Framework 1.1 or .NET Framework 2.0