BulkDelete
You can delete one or more records by specifying search criteria. The search criteria can include multiple related objects just like you would specify criteria for the Find method.
Please Note: If you do not specify any search criteria you will end up deleting all records in the table.
| C# | |
|---|---|
public virtual bool BulkDelete() | |
Return Value
True if the BulkUpdate was successful. You can see the AffectedRecords property to find out how many records were updated.You can delete many records at the same time in a single object.
| C# | Copy Code |
|---|---|
// Delete all orders that are older than 60 days. | |
In addition to search criteria on the table where records are being deleted you can also specify criteria on the related tables. The process is very simple, just create the joins and set the UseInSearch to true for the fields that you would like included in the search.
| C# | Copy Code |
|---|---|
// In this case we are deleting all orders placed by customers that have been a customer for longer than 6 months. | |
Target Platforms: .NET Framework 1.1 or .NET Framework 2.0