Welcome to MSDN Blogs Sign in | Join | Help

May 2008 - Posts

WindowsIdentity Impersonation using C# Code
using System; using System.Collections.Generic; using System.Text; using System.Security.Principal; using System.Runtime.InteropServices; using System.Security.Permissions; namespace Test { public class ImpersonateUser { [DllImport("advapi32.dll", SetLastError Read More...
Everything about AllowUnsafeUpdates
If you are a sharepoint developer, you have to read this one: What you need to know about AllowUnsafeUpdates . Read More...
Dynamic generation of a mouseover menu with cascading options
Menu Content Editor Web Parts SharePoint Menus in C# Read More...
SharePoint Object Model Tips
Nice work is done here Read More...
Maping from SPList Field Types to .Net Types
When I am working with the WSS Object model, I generally do not pass references to SharePoint objects around. I usually create business objects to represent the lists that I am accessing. I will then use an Adapter pattern to map from th SharePoint object Read More...
Custom toolbar of a SPView object on SPLite
Currently I’m in an engagement where I have to show the custom toolbar on a list view. I started my code to create a new SPView and attach the same one with SPList, I’m able to change query, title etc properties of view. But once I started to change ToolBarType Read More...
"The selected file was not found." - InfoPath 2007 Web form
What you mean 'not found'? grrrrrrrrrrrrrrr You can either apply that to me thinking that attaching a file to my InfoPath form would be easy or MS for allowing such a nasty insidious bug to crawl out into production. Here's the issue. I have an InfoPath Read More...
Add Custom Permission Level Programmatically
SPSite oSite = new SPSite ( <sharepoint site> ); SPWeb oWeb = oSite.OpenWeb(); SPRoleDefinition role = oWeb.RoleDefinitions[ "Custom Role" ]; role.BasePermissions = SPBasePermissions .AddListItems | SPBasePermissions .BrowseDirectories | SPBasePermissions Read More...
Site Navigation Settings
If you want to set Site Navigation Settings using API here is code :) Use this to specify the navigation items that you want to display in the navigation link bars of this site. Items in sublevels and flyouts can be modified only in the navigation of Read More...
Localization in InfoPath form in SharePoint
Here is the one another way I could implement to localize the InfoPath form in my current SharePoint engagement. 1: create the number of localize xml file, you want to support. File name format must be locale.xml as “en-US.xml”, “en-GB.xml” etc. 2: In Read More...
Upload, Activate, Deactivate, Remove Form Templates by Batch File
Here are commnds for bact file ------------------------------------------------------------------------------------------------ @echo off setlocal SET SPDIR="%ProgramFiles%\Common Files\Microsoft Shared\Web Server Extensions\12" SET FRONTIER_URL=http://siteurl Read More...
Infopath VSTO/ VSTA post-build steps
Here are the steps for the post-build to build and deploy the infopath forms automatically: 1. Deactivating the previous edition of the form stsadm -o deactivateformtemplate -url "SITE COLL URL" -filename "XSN FILE PATH" 2. Removing the previous version Read More...
Complete reference of all STSADM operations (with parameters) in MOSS 2007
A good jos done by Jose Barreto. In his blog you can find complete reference of all STSADM operations (with parameters) in MOSS 2007. Read More...
FAQ of InfoPath
Here is a good link for FAQ of InfoPath. Read More...
Programmatically add items to a drop-down list box in InfoPath 2007
Here you go for Sol'n Read More...
SPListItemCollection.GetDataTable() Bug?
There seem to be a bug when calling GetDataTable on an SPListItemCollection. Read more here. Read More...
Microsoft Knowledge Network Team Blog
Microsoft Knowledge Network Team Blog Read More...
SharePoint Content Deployment Wizard
The SharePoint Content Deployment Wizard is a tool for SharePoint 2007 which provides the means to deploy the following content: - site collections - webs - lists - folders - list items (including files) A good tool here Read More...
Working with large lists in Office SharePoint® Server 2007
Click here for a nice whitepapaper Read More...
Few Useful links for SharePoint developers
Tips and Tricks for Developing with Windows SharePoint Services Best Practices: Common Coding Issues When Using the SharePoint Object Model Best Practices: Using Disposable Windows SharePoint Services Objects Checklist for Creating SharePoint Web Parts Read More...
SharePoint 2007 and WSS 3.0 Dispose Patterns by Example
When writing customized SharePoint code you need to be aware of the scope and context of each SPSite , SPWeb , and PublishingWeb objects lifetime. Click here for a nice job done by Roger Lamb's . Read More...
SPListItemCollection is particularly inefficient because each loop executes a SQL operation
SPListItemCollection ic = list.GetItems(qry); foreach (SPListItem subitem in ic) { if (subitem.Folder == null) Doing a foreach across an SPListItemCollection is particularly inefficient because each loop executes a SQL operation to get the next row of Read More...
SPQuery with Boolean and DateTime
This isn't anything really new or unique but seemed worth bloging to have it one in place. A SPQuery can be used to retrieve some SPListItems from a SPListItemCollection. If you want to query on a Boolean field such as a Yes/No field (boolean) your query Read More...
SPQuery returns all items of a list and ignors Where clause
I’ve just spend an hour trying to find the source why SPQuery returns all items of a list and ignors where clause My code was like this: SPQuery query = new SPQuery(); query.Query = "<Query><Where>---------</ Where></Query>" SPListItemCollection Read More...
Access denied! Only SRP admin can Add Properties or section
Business Problem: Receiving an error when trying to add a Property to the PropertyCollection of the UserProfileConfigManage even running the code with elevated permissions, but obviously, it is not helping as the Identity of the application pool for the Read More...
InfoPath - Get the current user without writing code
A very good link to g et the current user without writing code in an InfoPath form. Read More...
Localization in InfoPath form
A very good link to implement localization in an InfoPath form. Read More...
Page view tracker