Speaking on SharePoint Connections in Amsterdam

By bhoeijmakers at November 18, 2011 09:18
Filed Under: Sharepoint 2010

I’m happy to announce that I will be doing a session on SharePoint Connections 2011 in Amsterdam next Wednesday the 23th of November together with my collegae Donald Hessing. We will be doing the same session that we did on the European SharePoint Conference in Berlin last October.

 

i'm-a-speaker

Taxonomy fields revisited: Getting the Term Store programmatically

By bhoeijmakers at November 04, 2011 16:12
Filed Under: .NET, SharePoint 2010

In my series of posts about using Taxonomy Fields in SharePoint 2010 I am using code to do all kinds of stuff with Taxonomy Fields and Terms from code. Because I can´t leave those fascinating Taxonomy Fields for what they are, here is yet another post about this subject Smile 

 

This is a follow up on my previous posts on this subject:

Using Taxonomy Fields in SharePoint 2010 - Part I

Using Taxonomy Fields in SharePoint 2010 - Part II

Using Taxonomy Fields in SharePoint 2010 - Part III

 

This post is meant for those of you that have read the previous posts (or attended one of my sessions on Managed Metadata Fields), and want to know more in order to write better code.

 

To get the Term Store from code I was using the following code in the Using Taxonomy Fields in SharePoint 2010 series of posts:

 

// set up the field for my termstore
TaxonomySession session = new TaxonomySession(site);
 
if (session.TermStores.Count > 0)
{
      // get termstore
      TermStore ts = session.TermStores[0];
 
      // more code here...
}

 

This is not very robust code and should not be used in a production environment. The code above gets the first (default) Term Store from the Taxonomy Session. But what if there are multiple Term Stores associated with the Web Application? In this post I will show you how to get the Term Store programmatically the right way More...

About the author

Bart-Jan Hoeijmakers is Lead SharePoint Developer at VX Company. Since 2006 he is the driving force behind the development of several enterprise SharePoint projects within VX Company. He is a hardcore developer in both SharePoint and ASP.NET and loves to dive into the dark sides of SharePoint development.

Month List