Canceling Changes to Entities and Entity Lists
Canceling Changes to a Single Entity
To cancel changes for a single entity, you can call the business object's CancelEntity() method. If you don't specify an entity, changes will be canceled for the business object's default business object (stored in its Entity property).For exampe, in C#:
Employee e = new Employee();
EmployeeEntity employee = e.GetEmployeeByID(1);
employee.LastName = "Smith";
e.CancelEntity(employee);
And in VB .NET:
Dim e As Employee = New Employee()
Dim employee As EmployeeEntity = e.GetEmployeeByID(1)
employee.LastName = "Smith"
e.CancelEntity(employee)
Canceling Changes to a List of Entities
To cancel changes for a list of entities, you can call the business object's CancelEntityList() method. If you don't specify an entity list, changes will be canceled for the business object's default entity list (stored in its EntityList property).For example, in C#:
Employee e = new Employee();
mmBindingList<EmployeeEntity> employeeList = e.GetEmployeesByRegion("WA");
foreach (EmployeeEntity employee in employeeList)
{
employee.Region = "CA";
}
e.CancelEntityList(employeeList);
And in VB .NET:
Dim e As Employee = New Employee()
Dim employeeList As mmBindingList(Of EmployeeEntity) = e.GetEmployeesByRegion("WA")
For Each employee As EmployeeEntity In employeeList
employee.Region = "CA"
Next
e.CancelEntityList(employeeList)
© (c) 2026 Oak Leaf Enterprises, Inc., 1996-2026 • Updated: 04/26/18
Comment or report problem with topic
