Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Please help me to compute document library size in sharepoint ?

Regards, Shiva Reddy.p

share|improve this question

2 Answers 2

up vote 2 down vote accepted

Taken from: http://sridharu.blogspot.com/2009/02/sharepoint-document-library-size.html

using (SPSite site = new SPSite("http://servername"))
{
   DataTable tbl;
   tbl = site.StorageManagementInformation(
   SPSite.StorageManagementInformationType.DocumentLibrary, 
   SPSite.StorageManagementSortOrder.Decreasing,
   SPSite.StorageManagementSortedOn.Size, 100);
   foreach (DataRow row in tbl.Rows)
   {
      foreach (DataColumn column in tbl.Columns)
      MessageBox.Show("Doc Lib Name :" + row["Title"].ToString() + "  Size (bytes): " + row["Size"].ToString());
   }
}
share|improve this answer
    
Thanks Brain , i got same solution. The above code will give the document library size.. –  shivareddy Oct 11 '10 at 8:36

Try space monitor (http://www.thesug.org/Blogs/lsuslinky/Lists/Posts/ViewPost.aspx?ID=33&RootFolder=%2FBlogs%2Flsuslinky%2FLists%2FPosts) a great free tool to analyse storage used by your entire site.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.