SharePoint on Cloud

SharePoint 365 is here! Now that's an edge.

From the SharePoint Blog
Whether you’re a small business or large enterprise the best way to learn about a new product offering like Office 365 is to experience it for yourself. From there it’s easy to build a plan that fits your business needs and make it your own.
·        Try it out - If you didn’t sign up for the beta back in April I would check out the Office 365 site and try it out today.
·        Develop a migration strategy and plan - There’s an immediate cost benefit to be gained by moving all your My Sites, Team Sites and Intranet Sites to SharePoint Online and the SharePoint Online planning guide for Office 365 will help you get started.
·        Customize and Extend with business solutions - Simplifying routine tasks using online forms and workflows is a great place to begin and for developers theSharePoint Online Developers Guide will help you quickly build simple applications and extensions tailored to your business.

How long a particular piece of code took to execute?

The Stopwatch class under the System.Diagnostics namespace is the key. The Stopwatch class makes it easy to use the high resolution timer in your code.


        // Create new stopwatch
 Stopwatch stopwatch = new Stopwatch();
 // Begin timing
 stopwatch.Start();
 // Do something
        // Code Here
 // Stop timing
 stopwatch.Stop();
 // Write result
 Console.WriteLine("Time elapsed: {0}",stopwatch.Elapsed);

The Taxonomy feature (Feature ID “73EF14B1-13A9-416b-A9B5-ECECA2B0604C”) has not been activated

Use the following command to activate the farm level "Taxanomy Feature" on your SharePoint 2010 farm before you try to add a custom column of the Managed Metadata type.

STSADM -o activatefeature -id 73EF14B1-13A9-416b-A9B5-ECECA2B0604C -url http://<ServerName>
<ServerName> is the name of the server hosting SharePoint.

SharePoint, Query & Large Result Set

SharePoint Server 2010 provides a class titled "ContentIterator", We can use it to query on lists with large number of rows.
We should consider using this class if our query returns more than 5000 items. The ContentIterator divides the list into batches and runs the query against one batch of list data at a time. For example


protected void OnContentIterator(object sender, EventArgs args)
{
     SPQuery listQuery = new SPQuery();
     listQuery.Query = "< Query >";
    SPList list = SPContext.Current.Web.Lists["List"];
    ContentIterator iterator = new ContentIterator();
    iterator.ProcessListItems(list,listQuery,ProcessItem,ProcessError);
}
public bool ProcessError(SPListItem item, Exception e)
{
   // Process the error
   return true;
}
public void ProcessItem(SPListItem item)
{
   // Process the item
}