internal void Delete()
        {
            if (_view.Confirm("Bulk Delete", "Bulk deletes can be very lengthy. Are you sure you want to do this?"))
            {
                using (FdoFeatureService service = _conn.CreateFeatureService())
                {
                    int deleted = service.DeleteFeatures(_className, _view.Filter.Trim(), _view.UseTransaction);
                    _view.ShowMessage(null, deleted + " feature(s) deleted");
                }

                if (_conn.Capability.GetBooleanCapability(CapabilityType.FdoCapabilityType_SupportsFlush))
                {
                    _conn.Flush();
                }

                _view.Close();
            }
        }
        private void DeleteFeatures(FdoFeatureTable table, FdoFeature[] features)
        {
            string filter = GenerateFilter(features);

            if (string.IsNullOrEmpty(filter))
            {
                _view.ShowError("Unable to generate a delete filter. Possibly this result set has no unique identifiers or this result set was produced from a SQL query. If this result set is produced from a standard query, make sure that *ALL* identity properties are selected");
                return;
            }

            int expectedCount = features.Length;

            using (FdoFeatureService service = _connection.CreateFeatureService())
            {
                //Deleting is based on a very simple premise, the filter should produce the
                //same number of affected results when selecting and deleting.
                //
                //In our case, the filter should affect exactly the expected number of results when selecting and deleting.
                long count = service.GetFeatureCount(table.TableName, filter, true);
                if (expectedCount == count)
                {
                    int deleted = service.DeleteFeatures(table.TableName, filter, true);
                    if (expectedCount == deleted)
                    {
                        foreach (FdoFeature feat in features)
                        {
                            table.Rows.Remove(feat);
                        }
                        _view.ShowMessage("Delete Feature", "Feature Deleted");
                    }
                }
                else if (count > expectedCount)
                {
                    _view.ShowError("Delete operation would delete more than the expected number of features (" + expectedCount + ")");
                }
                else if (count == 0)
                {
                    _view.ShowError("Delete operation would not delete any features");
                }
            }
        }