This MSDN article has a nice section on adding and removing event receivers.  However, after trying their code below to delete an event receiver, it will fail if you try to remove multiple event receivers.

you will get this error:

Collection was modified; enumeration operation may not execute.

        public override void FeatureDeactivating(SPFeatureReceiverProperties properties)
        {
            SPSite sitecollection = properties.Feature.Parent as SPSite;
            SPWeb site = sitecollection.AllWebs[“Docs”];
            SPList list = site.Lists[“MyList”];
            foreach (SPEventReceiverDefinition rd in list.EventReceivers)
            {
                if (rd.Name == “My Event Receiver”)
                    rd.Delete();
            }

To remedy this I specifically get the GUID’s of each event receiver and then delete them declaratively..

  public override void FeatureDeactivating(SPFeatureReceiverProperties properties)

        {

            SPSite sitecollection = properties.Feature.Parent as SPSite;
            SPWeb site = sitecollection.AllWebs[“Site Name”];
            SPList list = site.Lists [“List Name”];

            Guid Event1_Added = Guid.Empty;

            Guid Event1_Updated = Guid.Empty;

            foreach (SPEventReceiverDefinition rd in list.EventReceivers)

            {

                if (rd.Name == “Event1_Added”)

                {

                    Event1_Added = rd.Id;

                }//

                else if(rd.Name == “Event1_Updated”)

                {

                    Event1_Updated = rd.Id;

                }//

            }

            if (Event1_Added != Guid.Empty)

            {

                list.EventReceivers[Event1_Added].Delete();

            }//

            if (Event1_Updated != Guid.Empty)

            {

                list.EventReceivers[Event1_Updated].Delete();

            }//

        }

 

A nice way to see which event receivers are still on a list is to download SPManager from codeplex:

http://spm.codeplex.com/

By using this I found I was only deleting one of two event receivers every time I deactivated the feature.