MOSS 2007 : WSS 3.0 : How do you add items into Choice Site Column type.

Here is the sample code,                 SPWeb web = new SPSite(“http://karthick64:4040/”).OpenWeb();                SPField spField = web.Fields[“MyChoice”];                SPFieldChoice choiceFields = (SPFieldChoice)spField;                string[] choices = new string[3] {“x”, “y”, “z”};                foreach (string choice in choices)                {                    choiceFields.Choices.Add(choice);                }                choiceFields.Update(); Keep Exploring… 🙂


MOSS 2007: WSS 3.0: How to add/delete/update site columns by using SharePoint WebService

SharePoint’s Webs webservice can be used to add/delete/update site columns. Unfortunatley MSDN/SDK doesnot has the sample yet. Here I provide the sample code.             //webs webservice object             localhost.Webs websService = new ContentTypeAndSiteColumn.localhost.Webs();             //url for the webservice             websService.Url = “http://localhost:4040/_vti_bin/Webs.asmx”;             //credential             websService.Credentials = System.Net.CredentialCache.DefaultCredentials;               //xmldocument object             XmlDocument xDoc…


WSS 2.0 : How to upload images by using Imaging WebService

Here you go for the sample code.                  try                 {                             //create imaging web service object                             localhost.Imaging img = new ImagingTest.localhost.Imaging();                             //set url                             img.Url = http://localhost:8081/sites/site1/_vti_bin/Imaging.asmx;                             //Set credential                             img.Credentials = System.Net.CredentialCache.DefaultCredentials;                             //for results                             System.Xml.XmlDocument resdoc= new System.Xml.XmlDocument();                             System.Xml.XmlNode resnode = resdoc.CreateNode(System.Xml.XmlNodeType.Element,”Result”,””);                                                                                            System.IO.FileStream fs = new System.IO.FileStream(“c:\\n15.jpg”,  System.IO.FileMode.Open, System.IO.FileAccess.Read);                            //Get the content                            byte[] content = new byte[fs.Length];                            //store…


WSS 2.0 : "Getting unauthorized access" error when ‘User must change password at next logon’ is enabled

Problem Background : When you enable “user must change password at next logon”, then the corresponding user will face the unauthentication issues. To resolves this, you may enable IISADMPWD for WSS How to enable the IISADMPWD for WSS? To register iispwchg.dll, follow these steps: Click START, and then click RUN In the open box type the following…


WSS 2.0 : How to enable document library eventhandlers by default

Open the Site definition folder. If you use default Site definition, STS, then open the folder from the following location. “C:\program files\common files\Microsoft Shared\web server extensions\60\template\1033\STS Note: Modifying the default files is not supported by Microsoft. Microsoft recommends using custom Site Definition. Open the List Definition folder. If you use default list definition for document…


WSS 2.0 : stsadm – can’t delete wppack with slash in its name

If you install a wppack by using stsadm with slash “/”, then you will not be able to uninstall it by using the stsadm tool 🙁 . The story not endup here, you will not be able to install the latest version of your webpart :(. However SharePoint object model helps us to resolve the problem….


WSS 2.0 : How to save properties of webpart from webpart code

There are two methods, SaveChanges and SaveProperties provided by WSS which sometimes misleading users. Here I provide details for which method to use and when to use. SPWebPartCollection.SaveChanges()  – This method is used to save the changes made in the web part from out side the web part code. For e.g., the console application, windows application etc.., SPWebPartCollection.SaveProperties -…


WSS 2.0 : Technical details about localizing webpart and .dwp file

Problem : You are localizing the SharePoint web parts. You localiz display text and custom property names/descriptions using the ResourceManager and satellite assemblies. However, the web part “dwp” files in the cab file contain a title and description for each web part. You want to localize these values as per the msdn article.“Packaging and Deploying Web Part for Microsoft…


WSS 2.0 : How to reset Password in WSS – Account Creation Mode

Consider the following scenario. You installed WSS in Account Creation Mode. If a user forgets their password, they currently have to contact the admin and they in turn need to go into the site administration and manually reset the password. This issue has become more prevalent and will detract the Admin from normal duties.So I would like to…


SPS 2003 : How to enable your custom fields (columns) for search

Here you go for the steps to enalbe your custom fields to search. Step 1: Add the custom column (EmpName) in the Shared Documents document library Step 2: Add a document into the shared documents with custom column valuesStep 3: Crawl the content database Portal home page -> Site Settings -> Configure Search and Indexing -…