You can't use a Try/Catch block without specifying a catch. The code should
look like this even if you aren't handling the possible exception:
using System;
using Microsoft.SharePoint;
namespace WSS.Calendar.Events
{
class PreventDoubleBooking : SPItemEventReceiver
{
///<summary>
///This event is triggered when the user adds a new item
///<summary>
///<param name = "properties"></param>
public override void ItemAdding(SPItemEventProperties properties)
{
//Our query string variable
string strQuery = null;
try
{
//Get the SharePoint site instance
using (SPWeb oWebsite = new
SPSite(properties.SiteID).OpenWeb(properties.RelativeWebUrl))
{
//Get the collection of properties for the Bookingitem
SPListItemCollection collItems =
oWebsite.Lists[properties.ListTitle].Items;
//Get the calendar List that we will be querying against
SPList calendar = oWebsite.Lists[properties.ListId];
}
//Get the internal name of the fields we are querying.
//These are required for the CAML query
}
catch (Exception ex)
{
}
}
}
}