Welcome to Comunidade Bloggers |create|it| Sign in | Join | Help

Browse by Tags

All Tags » WSS V3
How to upload a list template
public static SPFile UploadListTemplate(string siteUrl, string templatePath) { using (SPSite site = new SPSite(siteUrl)) { SPDocumentLibrary templates = (SPDocumentLibrary)site.GetCatalog(SPListTemplateType. ListTemplateCatalog); System.IO.FileInfo fileInfo Read More...
How to upload a site template
public static SPFile UploadWebTemplate(string siteUrl, string templatePath) { using (SPSite site = new SPSite(siteUrl)) { SPDocumentLibrary templates = (SPDocumentLibrary)site.GetCatalog(SPListTemplateType.WebTemplateCatalog); System.IO.FileInfo fileInfo Read More...
How to create an item in a discussion list
Creating a discussion in discussion list is different from creating a simple list item. The code for creating a discussion item is: using (SPSite site = new SPSite("SITE URL")) { using (SPWeb web = site.OpenWeb()) { SPList list =web.Lists["LIST TITLE"]; Read More...
Built-In ContentType and Field Ids
Only today that I've found that the WSS object model has 2 classes that hold all the IDs of the built-in ContentTypes and Fields. Instead of doing things like this: SPListItem item = list.Items.Add(); item["Title"] = "bla la bla"; Read More...
ItemUpdating, AfterProperties and field names
I was checking for a field value change in a WSS V3 list with the help of event handlers with no success. In the ItemUpdating event, the list item has the current values of the item and the AfterProperties has the values that the item will have after Read More...
How to add a group to a WSS v3 site
Get the group SPGroup group = web.SiteGroups["GROUP_NAME"]; Create a role assignment SPRoleAssignment newRoleAssignment = new SPRoleAssignment(group); Add the role definition (Full Control, Read, Contribute, …) to the role assignment Read More...
How to use FullTextSqlQuery to search in WSS
First, you have to add the following references: Microsoft.Sharepoint Microsoft.Sharepoint.Search Second: DataTable resultsDataTable = new DataTable(); using (SPSite site = new SPSite( "http://server" )) { FullTextSqlQuery query = new FullTextSqlQuery(site); Read More...
How to use KeywordQuery to search in WSS
First, you have to add the following references: Microsoft.Sharepoint Microsoft.Sharepoint.Search Second: DataTable resultsDataTable = new DataTable(); using (SPSite site = new SPSite( "http://server" )) { KeywordQuery query = new KeywordQuery(site); Read More...