SHARE
TWEET

Untitled

Ortund Apr 8th, 2014 36 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     public void DeletePost()
  2.     {
  3.         string result = String.Empty;
  4.  
  5.         try
  6.         {
  7.             var post = (from p in ne.posts
  8.                         where p.postid == postid
  9.                         select p).FirstOrDefault();
  10.             if (post != null)
  11.             {
  12.                 ne.DeleteObject(found);
  13.                 ne.SaveChanges();
  14.             }
  15.         }
  16.         catch (Exception ex)
  17.         {
  18.             lblErr.Text = String.Format("<p>An error occurred while trying to delete your post:</p><p>{0}</p>", ex.InnerException);
  19.         }
  20.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top