Sharepoint 2010 Managed Metadata - unable to get Term from TermSet
Posted
by Blakomen
on Stack Overflow
See other posts from Stack Overflow
or by Blakomen
Published on 2010-03-26T00:10:46Z
Indexed on
2010/03/26
0:13 UTC
Read the original article
Hit count: 1640
Hi guys,
Having a really aggravating problem using Managed Metadata in SP2010 where I can get a Taxonomy Session, Term Store and Term set fine, but when I try to retrieve a term from the term set, I get a TermStoreOperationException which says that it "failed to read from or write to database".
Does anyone have any idea as to why I can get the Term Set but not the terms? I can't quite understand why when they all reside in the same database I can get the set but not the terms within it.
The code I'm using is below:
TaxonomySession txSession = new TaxonomySession(site, true);
TermStore termStore = txSession.DefaultSiteCollectionTermStore;
TermSet termSet = termStore.GetTermSet(txField.TermSetId);
TermCollection termCollection = termSet.GetTerms(xnField.InnerText.Trim(), true); //exception thrown on this line.
Any ideas or insight or solutions would be really appreciated.
Thanks heaps!
© Stack Overflow or respective owner