Welcome to plsql4all.blogspot.com SQL, MYSQL, ORACLE, TERADATA, MONGODB, MARIADB, GREENPLUM, DB2, POSTGRESQL.

Saturday, 25 April 2015

Delete list item programmatically by id

SPSecurity.RunWithElevatedPrivileges(delegate() {
oWeb.AllowUnsafeUpdates = true; SPList oList = oWeb.Lists[sRequestList]; SPListItem oVoucher = oList.GetItemById(Convert.ToInt32(Request.QueryString["RequestNo"])); oVoucher.Delete();
oList.Update(); oWeb.AllowUnsafeUpdates = false;
});

Please provide your feedback in the comments section above. Please don't forget to follow.