-
- using(SPSite oSite = new SPSite("Your Site Url")) {
-
- using(SPWeb oWeb = oSite.RootWeb) {
-
- SPList oList = oWeb.Lists["Your List Name"];
-
- listItemId = 1;
-
- SPListItem itemToDelete = list.GetItemById(listItemId);
- itemToDelete.Delete();
- }
- }
Here I have delete the first record in SharePoint List.