Hi,
I have added a ItemAdded event, which has the code as below:
public override void ItemAdded(SPItemEventProperties properties)
{
SPListItem currentItem = properties.ListItem;
SPList testList = null;
SPListItem currentItem = null;
//get the current site
SPWeb currentSite = properties.Web;
//get the list
if (currentSite != null)
{
testList = currentSite.Lists.TryGetList("My List");
}
if (testList != null)
{
// Other conditions
//Spquery
currentItem.Update();
}
}How to dispose the SharePoint Objects?
Thanks