SharePoint: How to retrieve specific version of file from a document library thro’ programmatically?

The SPFile.Versions API can be used to retrieve the specific version of the document library.   I have compiled a sample code snippet to retrieve the specific version of the document library.               //Open the web             SPWeb web = new SPSite(“http://karthickmain:9091/sites/siteb”).OpenWeb();             //Get the folder             SPFolder folder = web.Folders[“Shared Documents”];             //Get…


SharePoint: How to add news listings to the News Area thro’ programmatically

I compiled a sample piece of code snippet to add news listings to the news area.               //Site object             SPSite site = new SPSite(“http://karthickmain:9090”);             //Get the portal context             PortalContext context = PortalApplication.GetContext(site.ID);             //Get the news area guid             Guid newsGuid = AreaManager.GetSystemAreaGuid(context, SystemArea.News);             //Get the new area             Area…


SharePoint: PortalContext – gives “Value cannot be null. Parameter name: site”

I came across the following problem in PortalContext API.   Say I have created a portal with port number 9091. I am using the following code snippet to retrieve the portal context.   [working though we changed the port number] TopologyManager tm = new TopologyManager(); PortalSite ps = tm.PortalSites[ new Uri[http://karthickmain:9091)]; PortalContext ctx = PortalApplication.GetContext(ps);…


SharePoint: How to retrieve the list of item from the Sub folders by using Lists.asmx web service

Unfortunately SPS SDK doesn’t provide sample to get the details from the subfolder. I have compiled a sample code snippet to achieve it. Here you go for the code.               localhost.Lists listService = new localhost.Lists();             listService.Credentials = System.Net.CredentialCache.DefaultCredentials;             //url and folder name hard coded – modify it as per your requirement.            …


SharePoint : SPWeb.AlternateHeader issue – does not accept empty “” string

Recently I see this problem in SPWeb object. I have configured the alternate header in the onet.xml. I created the sites. Now I want to revert back the alternate header configured and set it to empty. As we know already, what ever the modification made on the onet.xml will be picked up by the newly…


MCMS 2002 : List of some important hotfixes for CMS 2002 SP2

912356 – The Web server may stop responding when you try to generate a channel path by using the MCMS API in Content Management Server 2002 913400 – You receive an error message when you try to use SQL authentication mode in the Database Configuration Application (DCA) after you install Content Management Server 2002 SP2…


SharePoint : Programmatically access "Manage crawls of Site Directory"

Programmatically access “Manage crawls of Site Directory” The Manage Crawls of Site directory is a Area Listing as like Best Bet Keywords. The following piece of code snippet can be used to access the “Manage crawls of Site Directory” through SPS object model. The crawl is part of DeepCrawl AreaListings. The Status (SiteDate.ListingStatus) property of…


SharePoint : Add group of users to the user collection programmatically

The sample code as follows.     SPWeb web = new SPSite(“Site URL”).OpenWeb();    SPUserInfo[] userInfo = new SPUserInfo[1];    userInfo[0].Email = “”;    userInfo[0].LoginName = @”domain\username”;    userInfo[0].Name = “username”;    userInfo[0].Notes = “Test”;    web.Roles[“Reader”].Users.AddCollection(userInfo);    


SharePoint : .net 2.0 and SQL Server 2005 Supportability

Windows SharePoint Services (WSS) Support for running on 64-bit systems in 32-bit emulation mode Support for reverse proxy Support for IP-bound virtual servers Support for off-box SSL termination Support for Microsoft SQL Server 2005 Support for 2.0 SharePoint Portal Server 2003 Post SP2 supports SQL Server 2005 but not 2.0;en-us;907763 Service…


SharePoint : Top Area Navigation Drop Down Menu Control

This menu control works based on external JavaScript and CSS file. These files are sample only. Follow the following steps to install the web control into the page. Step 1:  Create Web Control (I know you know all these steps, but just adding bit…) Open Visual Create New Visual C# Web Control Library Project….