locked
How to delete a sitecollection based on SiteCollection ID? RRS feed

  • Question

  • HI

    How to delete a siteCollection  based on SiteCollection ID?

    Thanks

     


    rihdus
    Monday, July 11, 2011 11:06 AM

Answers

  • Try to be more precise, and use google for basic things...

    using (SPSite oSite = new SPSite(siteID))

                {

                    oSite.Delete();

                }

     


    My SharePoint blog: http://blog.voltje.be Twitter: voltje
    • Proposed as answer by Frederik Prijck Monday, July 11, 2011 11:35 AM
    • Marked as answer by Shimin Huang Wednesday, July 13, 2011 3:45 AM
    Monday, July 11, 2011 11:35 AM
  • using(SPSite siteCollection = new SPSite(id))

        siteCollection.Delete();

     

     

    • Marked as answer by Shimin Huang Wednesday, July 13, 2011 3:45 AM
    Monday, July 11, 2011 11:36 AM

All replies

  • Try to be more precise, and use google for basic things...

    using (SPSite oSite = new SPSite(siteID))

                {

                    oSite.Delete();

                }

     


    My SharePoint blog: http://blog.voltje.be Twitter: voltje
    • Proposed as answer by Frederik Prijck Monday, July 11, 2011 11:35 AM
    • Marked as answer by Shimin Huang Wednesday, July 13, 2011 3:45 AM
    Monday, July 11, 2011 11:35 AM
  • using(SPSite siteCollection = new SPSite(id))

        siteCollection.Delete();

     

     

    • Marked as answer by Shimin Huang Wednesday, July 13, 2011 3:45 AM
    Monday, July 11, 2011 11:36 AM