I am trying to display some usage data for SharePoint in a web part.
Here is my code:
SPSite spSiteCollection = new SPSite(myURL) spSiteCollection.CatchAccessDeniedException = false; SPWeb spWeb = spSiteCollection.OpenWeb(); DataTable dtResults = new DataTable(); dtResults = spWeb.GetUsageData(SPUsageReportType.url, SPUsagePeriodType.lastMonth);
The DataTable, which should contain the results, is always zero. I also tried running this from an aspx page, but nothing.
Idriss selhoum
source share