.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Restoring from Site Collection Recycle Bin - Item Added

Posted By:      Posted Date: September 16, 2010    Points: 0   Category :SharePoint
When I restore a list item from the normal recycle bin I can access the item using properties.ListItem. However, when restoring from the Site Collection recycle bin, the listitem is null?! Ok, I thought, the SPItemEventProperties object I have also provides me with WebUrl, ListId and ListItemId so I can spin up a new SPSite with WebUrl, use openweb to get my SPWeb, use ListId to get the correct list and then the ListItemId to get the item. A bit long winded but should get me where I need to be. This would be ok, but at runtime I got an exception list not found. On investigation it seems the WebUrl property is wrong. I've run this on a few different lists/sites and it is consistently wrong! The value I'm seeing is http://[webapp]/sites/[sitecol]/sites/[sitecol]/[web]. Note the repitition of /sites/[sitecol]?! This is really frustrating and very poor. So not only is the ListItem property null(?), but there is no easy way to get the list item manually! Does anyone else see this behaviour? Sharepoint is really testing my sanity this week!    

View Complete Post

More Related Resource Links

Restore from Recycle Bin - ItemAdding and Item Added

When restoring an item (specifically a document back to a document library) I need to be able to conditionally stop the restore from occuring. Let me tell you why... Say I have a doc lib with a custom column on. The column is of type datetime. The value in the column has to be unique. To do this I have an event receiver on itemupdating which runs a simple CAML query on the list to check that the value I provide is not being used elsewhere. If this test passes the update occurs, if not I do a properties.ErrorMessage="Column must contain a unique value" and a properties.Cancel=true. Simple. My problem is, say someone uploads a document, doc A, and gives it the date 01/01/2011. If I try and upload document B with the same date it will stop me - good. However if document A is deleted and I add my document B with 01/01/2011 it will allow that - still good as nothing in the doc lib has that date. The problem now would be if someone restored document A back to the library document A and B would both have the date 01/01/2011. Not good. I've had a look at the event receivers and the SPItemEventProperties object when a restore is performed and both adding and added fire. During adding there doesn't seem to be any of the original list item meta data available for me to interogate? During itemadded I can see the values on the SPListItem contained within the SPItemEventProper

How to find newly added item in the share point site?

How to find the recently added item in the share point page If the any user added the items in the custom list, library, list,Announcement, Picture library,etc......... i need to show all item that added last 2 days. Is that any object model available to find all item in the share point site???Instead of searching every list.

Update all Properties in the User Information List after restoring a site collection to a new domain


hi All

I moved a site collection (content db) from one domain to another. After the site collection was restored i ran the stsadm -o migrateuser -oldlogin -newlogin. The result was that the login id of the user in the source domain was replaced with the login in the destination domain.

However the rest of the properties in the User Information List (paricularly interested in the Email) was not updated.

How can i get all the properties in the User Information List with values in the new domain

Thanks in Advance


Site Collection Administrator and Recycle Bin


Hey everyone,

I would like to know if it iwas possible to block the site collection administrator from accessing the site collection recycle bin.



Create workflow to create list item in calendar list of a DIFFERENT site collection


I work for a school district.  Each school has a SharePoint calendar.  We set up each school as its own site collection.  I would like to create a workflow that would send their calendar events to a district calendar, which is also its own site collection.

Example,  School A enters creates a new item on their personal school calendar.  They click YES in the column called SendToDistrictCalendar.  The workflow would be triggered to create this same item in the district calendar (which is in a different site collection) when SendToDistrictCalendar is checked YES.

We're using Windows Server 2003 with Windows SharePoint Services 3.0

I am a mid-level SharePoint user.  I would appreciate ANY and ALL help to make this work!!


Added Metadata (Taxonomy) to Document Type at Top Level Site Collection; How to break inheritance at


We're really loving the ease with which we can add site columns to content types, and have them propagate through all lower-level sites. This is awesome, especially when combined with taxonomy in the term store!

However, our Intranet is to feature a publishing site with subsites to house inter and intra-departmental, private working groups who develop material outside of the public Taxonomy term store and outside of traditional requirements for taxonomy data. This covers a specific area of navigation; the RED HIGHLIGHTED navigation and sub-navigation (not pictured) should all exist without the taxonomy column requirement required of all other sites and subsites.

Example: http://ctnation.citizenschools.net/DotNetNuke/images/WOW_Sample.jpg 

In building the site template for the Workspaces sites, I want to remove all requirements for all content types for the public-site-wide-taxonomy. However, when I edit the content types at the sub-site level, there seems to be no ability to break inheritance from the parent information, and thus, all content types require the taxonomy column (as defined at the root-site level). 

Given the need to remove the site column from all content types, libraries and lists in this Work

File Restore after Site Collection Recycle bin




Is there any way to restore the file after get deleted from Site Collection Recycle bin like restoring from Data base. I have details of file like file name, deleted by, path of the file.





New site columns added using xml,not shown in existing site collection


I have added new site columns to the existing content type using xml,deployed to a sharepoint application as a feature using VS2010. Now my problem is the site columns are not updated in existing pages under site coolection,it is showing only the existing site columns and not the new site columns. I then tried adding those site columns to the pages library manually,after that it is displaying those columns in pages and i can enter text in edit mode but whenever i save the page it is rendered with some tags like <span id="msrterangecursor">. It is shown for only new site columns.

Could anyone help with this.

Site Collection Usage Summary: No Data Available


Usage analysis processing is enable for my farm in both Central Administration and in the SSP.

I've checked TImer Job Status and the three timer jobs responsible for doing the log analsis are all running.

I've also checked the log file locations and the log files are being generated.

Yet when I browse the "Site collection usage summary" report (SpUsageSite.aspx) I get the following:

No data is available for this report. Usage analysis might have been enabled only recently, or there might have been insufficient usage to result in any values for the report.

My farm is running 2007 Enterprise SP2 (

Can someone confirm if this issue was fixed with one of the CU's that were issues post-SP2?

Site Collection Usage Report Include Outlook?


Hi all,

Does anyone know if the Site Collection Usage Report includes activity that occurs from Outlook? For example, if a user contributes to a discussion board without ever physically touching the site or if the user just reads list content from Outlook, is this included?

ANY help at all is greatly appreciated.


Portal Search Work - Site Collection Search Does Not


In our SharePoint installation we have an SSP which indexes local office sharepoint server sites.  However there is a problem, although we can do portal searches which reveal search results it is not able to do local searches at the site collection level and as a result we are presented with the typical error below.


No results matching your search were found.

  1. Check your spelling. Are the words in your query spelled correctly?
  2. Try using synonyms. Maybe what you're looking for uses slightly different words.
  3. Make your search more general. Try more general terms in place of specific ones.
  4. Try your search in a different scope. Different scopes can have different results.

I am unsure as to why this strange event is occuring.  We do not have the WSS Search component running in the MOSS environment as the SSP service should be able to index and server search queries at the portal and local site collection level.


Any thoughts to this?



Video: Site Collection Solution Galleries in SharePoint 2010

This demonstration shows the solution gallery and solution management features of SharePoint 2010. (Length: 4:01)

Only crawl one site collection

Hi We have an intranet with about 100 site collections. How can I set up one of those to be in a separate content source that can be crawled more often? Do I need to make two content sources with one containing the other 99 site collections with the setting "Crawl only the SharePoint Site of each start address" and the other one containg my prioritized site collection with the same setting? I also would like to ask if the crawl rules have any effect on in which order the content is crawled. If I put a certain site to be included with order 1 will that site always be crawled first? //Niclas

Error Executing CLR Stored Procedure "Item has already been added. Key in dictionary"

Hello, I'm consuming a web service through assemblies in a Sql Server 2005 database. The client was made with VB.net 2005. Everything was fine in the deploy phase but once I compile the assembly generated in my sql server database and try to execute the CLR stored procedure defined in the assembly it crashes throwing the following error: Error: There was an error generating the XML document. Inner Exception: Item has already been added. Key in dictionary: 'SqlCifin.InfoComercial.ParametrosConsultaDTO' Key being added: 'SqlCifin.InfoComercial.ParametrosConsultaDTO' Where SqlCifin is the name of the assembly, InfoComercial is the web reference namespace and ParametrosConsultaDTO is a complex type defined in the WSDL to encapsulate the request parameters. I tried almost everything but nothing seems to work: Already checked the enviroment variables and . I would appreciate any help you can provide me.  PD: I'm using WSE 3.0. Thanks, Andres Diab.

site collection size

what is the solution of a site collection if its size grows beyond 100GB?  There is no way we can split it into two site collections and the content database will be large than 100GB even if it contains a signal site collection. Thanks in advance, Peter  

CLR Stored Procedures with WSE - Error "Item has already been added. Key in dictionary"

Hi, I'm developing a CLR Stored Procedure that consumes a Third party Web Service with WSE 3.0 (Due to WS Owners). Everything was fine in the Visual Studio Framework, but once I deploy the assemblies in my database and try to call the service from a query windows, it shows an error message:  Error: There was an error generating the XML document. Inner Exception: Item has already been added. Key in dictionary: 'SqlCifin.InfoComercial.ParametrosConsultaDTO' Key being added: 'SqlCifin.InfoComercial.ParametrosConsultaDTO' Stack Trace: at System.Xml.Serialization.XmlSerializer.Serialize(XmlWriter xmlWriter, Object o, XmlSerializerNamespaces namespaces, String encodingStyle, String id) at System.Xml.Serialization.XmlSerializer.Serialize(XmlWriter xmlWriter, Object o, XmlSerializerNamespaces namespaces, String encodingStyle) at System.Web.Services.Protocols.SoapHttpClientProtocol.Serialize(SoapClientMessage message) at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) at SqlCifin.InfoComercial.InformacionComercialWSServiceWse.consultaXml(ParametrosConsultaDTO parametrosConsulta) at SqlCifin.StoredProcedures.sp_consultaXml(SqlString i_cod_info, SqlString i_motivo, SqlString i_ced_ruc, SqlString i_tipo_ced, SqlXml& o_xml)   I think it has to be something with the WSE but not completely sure. I really need to go t

SharePoint Search not working on one site collection

I am running into some weird behavior with how SharePoint is crawling site/list data.  Let's say our main intranet site is http://www.intranet.com: Most of our older sites are setup with URLs like http://www.intranet.com/sites/sitename .  Crawling is working fine on these sites and I can execute a search and find all of the results I would expect.  At some point recently (before I joined this firm), they made a decision that all new sites would have the URL http://www.intranet.com/SiteDirectory/sitename .  Any sites which fall into this bucket are not being crawled, it would seem. If I check Central Adman>Shared Services>Search Administration, I can see that the first content source being crawled is http://www.intranet.com so I would imagine this crawl should pick up anything under /SiteDirectory/ but it is not.  I also checked the Crawl Settings on this page and it is set to "Crawl everything under the hostname for each start address".  Lastly, I see that there were only 21 errors in the last full crawl but none of these errors apply to a /SiteDirectory/ site. In short, what could be causing the crawl to apparently skip all of the sites within /SiteDirectory/ and how can this best be fixed?
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend