How can I delete a elements in secound list bounded with secand list if I delete elements in first list.
I write a code, but i don't know how to delete a bounded item, please help:
public override void ItemAttachmentDeleting(SPItemEventProperties properties)
{
base.ItemAttachmentDeleting(properties);
if (properties.List.Title == "Wpisy")
{
SPSite oSiteCollection = new SPSite("http://wasp03/");
SPWeb witryna = oSiteCollection.RootWeb;
SPListItemCollection firstList = witryna.Lists["Wpisy"].Items;
SPListItemCollection secoundList = witryna.Lists["Szczegoly"].Items;
foreach (SPListItem ofirstList in firstList)
{
foreach (SPListItem osecoundList in secoundList)
{
if (ofirstList.ID.ToString() == osecoundList["ID_z_Wpisy"].ToString())
{
}
}
}
}
}