Sharepoint 2010 托管元数据 - 无法从术语集中获取术语
在 SP2010 中使用托管元数据时遇到了一个非常严重的问题,我可以很好地获得分类会话、术语存储和术语集,但是当我尝试从术语集中检索术语时,我收到一个 TermStoreOperationException,它表示它“无法读取”来自或写入数据库”。
有人知道为什么我可以获得术语集而不是条款吗?我不太明白为什么当它们都驻留在同一个数据库中时我可以获得该集合但不能获取其中的术语。
我正在使用的代码如下:
TaxonomySession txSession = new TaxonomySession(site, true);
TermStore termStore = txSession.DefaultSiteCollectionTermStore;
TermSet termSet = termStore.GetTermSet(TermSetId);
TermCollection termCollection = termSet.GetTerms("My Term", true); //exception thrown on this line.
任何想法、见解或解决方案将不胜感激。
多谢多谢!
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(TermSetId);
TermCollection termCollection = termSet.GetTerms("My Term", true); //exception thrown on this line.
Any ideas or insight or solutions would be really appreciated.
Thanks heaps!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我设法通过使用术语集上的索引器来获取术语来解决这个问题:
我不确定为什么 .GetTerms() 不起作用 - 这可能是因为 SP2010 仍然不是 RTM,它应该是一个是内功,还是其他一些我无法理解的神秘原因……
I managed to get around this by getting the Term just by using the indexer on the Term Set:
I'm not sure why .GetTerms() doesn't work - it might be because SP2010 is still not RTM and it's meant to be an internal method, or some other mysterious reason beyond my comprehension...