.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Error while creating Termstore using Object Model

Posted By:      Posted Date: September 16, 2010    Points: 0   Category :SharePoint
Hi, I'm creating term store Group using object model using the below mentioned code:- string TermStore = drManagedMetadataGroups["Term Store"].ToString(); string GroupName = drManagedMetadataGroups["Group Name"].ToString(); string Description = drManagedMetadataGroups["Description"].ToString(); string GroupManagers = drManagedMetadataGroups["Group Managers"].ToString(); string Contributors = drManagedMetadataGroups["Contributors"].ToString(); try { //Type importManagerType = typeof(ImportManager); //Type[] parameterTypes = new Type[1] { typeof(TermStore) }; //ConstructorInfo constInfo = importManagerType.GetConstructor(BindingFlags.NonPublic | BindingFlags.Instance, null, CallingConventions.ExplicitThis, parameterTypes, null); //if (constInfo != null) //{ TaxonomySession session = new TaxonomySession(web.Site); TermStore ts = session.TermStores[TermStore]; //ts.AddTermStoreAdministrator(@"test-account-01\d39373g"); //logger.LogToOperations(string.Format("Added managed metadata group administrator '{0}' to '{1}'", GroupName, TermStore), EventLogEntryType.Information); if (!M

View Complete Post

More Related Resource Links

OneNote 2010: Creating OneNote 2010 Extensions with the OneNote Object Model


Learn how to build applications and plug-ins that interoperate with data from OneNote 2007 and 2010 using the OneNote Object Model library freely available on CodePlex. Andy Gray demonstrates how easy it is to integrate information from OneNote notebooks, sections and pages into smart client and Web apps.

Andy Gray

MSDN Magazine July 2010

(401) Unauthorized Error working with Client Object Model


Hi All,

I'm tryiing to retrieve a list of document libraries from a sharepoint site, here is my code, this is a windows app
  public string[] GetDocumentLibraries(string siteUrl)
            Collection<string> libraries = new Collection<string>();
                //Creating the client context object, establishing the connection from the client to the remote SharePoint site
                ClientContext ctx = new ClientContext(siteUrl);

                //Authetication on SP site
                string user = ConfigurationManager.AppSettings["user"];
                string password = ConfigurationManager.AppSettings["password"];

Creating SPContentDatabase programatically using Object Model


Hi I m trying to create a content database programatically but getting the error "Object reference not set to an instance of an object."

any help would be highly appriciated....

Thanks in Advance.....

Remote Debugging error while creating business data connectivity model


Hi Everyone,

                  I have a scenario where I have to get the data from two of the stored proc's in the SQL Server and create an assocation between those models.I cannot use Sharepoint designer as there is no relationship existing between those two entities.So,I have used visual studio business data connectivity model to fulfill this requirement.I created the model with filter descriptors,input parameters and all and related those as suggested by MSDN and used LINQ to SQL to pull the actual stored procedure into the readlist and readitem methods.My issue here is,when I debug this project,I am receiving an error message tht says "remote procedure cannot be debugged.this usually indicates debugging hasn't been enabled".Then I changed the debug entry in the web.config to true to solve this issue.But,still I received the same error...what do you think might be stopping me from going ahead..ur suggestions and tips helps me a lot..


Thanks all..


Error when using Client object model in Sand box solutions


Me created a web part using sandboxed solution

And used share point Client object model (.net managed COM) to access a list which is there in another site collection,

Getting error as follows:

Web Part Error: Unhandled exception was thrown by the sandboxed code wrapper's Execute method in the partial trust app domain: An unexpected error has occurred. 

Is it possible to get data from other site collection in same web application using sharepoint client object model?

Client object Model partial trust error


HELLO  i have a sandbox solution webpart and i,m trying to execute below code in button click

 ClientContext CC = new ClientContext(SPContext.Current.Web.Url);
        List MyDiscussionList = CC.Web.Lists.GetById(new Guid("30F27722-C0DC-4CF6-9D42-43DE5747DD8F"));
        CamlQuery Qry = CamlQuery.CreateAllFoldersQuery();
        Qry.ViewXml = "<View><Query><Where><Eq><FieldRef Name='Title'/><Value Type='Text'>" + DiscussionName + "</Value></Eq></Where></Query></View>";
        Microsoft.SharePoint.Client.ListItemCollection LstCollection = MyDiscussionList.GetItems(Qry);

but when it gives exception of partial trust error

Unhandled exception was thrown by the sandboxed code wrapper's Execute method in the partial trust app domain: An unexpected error has occurred.

can i execute client object model code through sandbox?



Gettin error in Updating user field using object model



I have multiple site collections and I have to update user filed in each site collection for particular user say X to Y.Now the problem is that display name of user X is resolved in different way in different site collection.In some site collection user x shows correct names and items get updated while in some it takes display name as login name and the query which i created fails.

How to resolved this user issue?

Using the Client Object Model to read values from Excel file produces 504 error



I use the Client Object Model to retrieve and read values from an Excel file. This is triggered in an Event Receiver on the Document Library where the Excel file lives. I use a simple CAML Query to retrieve the file. This has worked just fine on a dev/test server. 
Now, I just recently deployed this solution to a production/live server and now this code doesn't work anymore. I get an error saying 'The remote server returned an error: (504) Gateway Timeout'. This happnes when I try clientContext.ExecuteQuery();

The difference between the two servers is that on the test server (where it works) the solution is sitting as the root site, so to speak. No host headers or nothing.
On the live server, there are several web applications (SharePoint) on the same port, but with different host headers.

I have tried to trace a little bit and I found that on the test server, the url that is used to create the ClientContext object is 'http://<servername>/<webname>'. The url is comes from the following code: web.Url. I tried changing the url to the DNS name the test server has and that resulted in the same error as on the live server.

Does anyone have any idea what I need to do?

Thanks a billion!

Error while creating Report model Report model project


Hi Everyone,

                  I am getting an error:"Value cannot be null.Parameter name :item".When trying to creating Report model in the Report model project ,but able to create Data Source and Data Source View.If anyone has come across this problem and got the solution,kindly share it ,i am need of the solution very much .



Chaithanya M

Overview of SharePoint Object Model

SharePoint offers a set of structured server-side objects those are widely used to program SharePoint Applications. These objects are hierarchically arranged and you can drill down through the object hierarchy to obtain the object that contains the components of SharePoint Application you need to use in your code.

Jscript error: Object does not support property or method


 Hi, i have little knowledge on javascript but i need to use this code get from somewhere for a jquery to work.

I face this "Jscript runtime error: Object does not support property or method" whenever im trying to run this page.

In my experience, im get this error msg 9 out of 10 times i use javascript in my system.

Im using Microsoft Visual web developer 2008, i wonder if this is related to my problem, i not sure there is anything i need to add as reference or update anything.

But anyway, in short, i just couldn't use javascript code when using this development tool because of this sort of error.

Anyway, it happen that last time i tried use the same type of jquery code in another project and it seems to work well without an error.

But now when im try to use it again in this recent project i created, it come out with this error and i have no idea how to solve it even look through google and this forum.

It doesn't really seems like its the code problem itself although im not sure, because any javascript code just couldn't work.

So below is my code that i need to use.

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" ></script>
<script type="text/javascript" src=&quo

command object error


Could someone please tell me what is wrong with my syntax here?  I'd be much appreciative.


objCmd = New SQLCommand("SELECT CASE WHEN objDR('Item') = 'Enter Bill of Lading' then enterbol " _  

& "WHEN objDR('Item') = 'Bill of Lading History' THEN bolhistory " _  

& "WHEN objDR('Item') = 'Request Transfer' or objDR('Item') = 'View Transfer in Progress' THEN transfers " _  

& "END  from plantGroups where plantgroupid=@plantgroupid", objConn)

Registering controls of current assembly object reference NOT set error


Hi There,

I have created a simple ASP.net Web Application (2.0) and have added a web user control.

Now in my page I have added this control but I have registered like this,

<%@ Register Assembly="WebApplication1" Namespace="WebApplication1" TagPrefix="Custom" %>

Which means I want to access all the controls in my current Web Application project

Then I have added my user control like this,

<Custom:MyUserControl ID="MyUserControl1" runat="server" PublicProperty="Hello" />

Every thing is fine but when I execute the project, NO control on my user control gets "instantiated" and thus I receive error "Object Reference Not Set"

Note that My Control has,

1) Public property PublicProperty as String

2) 1 Label control

In Load Event Handler I am setting Text property of Label Control to PublicProperty. Here object reference NOT set error occurs (which means Label control is NOT initialized).

I don't want to register my control using Src, TagPrefix etc. Any ideas?


.NET Exceptions: Make the Transition from Traditional Visual Basic Error Handling to the Object-Orie


If you're used to Visual Basic 6.0 and you're making the transition to Microsoft .NET, you will find that error handling is quite different from what you've used for years. Visual Basic .NET uses a more object-oriented solution to signaling and responding to unexpected problems while your program is running. This approach, called structured exception handling, has a number of advantages over the On Error statements provided in previous versions of Visual Basic. For instance, exceptions give you lots more information about exactly what went wrong in your app. To help you take advantage of this modern error handling paradigm, this article will show you how to raise and respond to exceptions, as well as how to create your own custom exception classes.

Jesse Liberty

MSDN Magazine November 2002

Scripting: Windows Script Host 5.6 Boasts Windows XP Integration, Security, New Object Model


Windows Script Host (WSH) 5.6, a major upgrade for the WSH environment, provides some significant improvements over previous versions. A brand new security model that is tightly integrated with security in Windows XP allows administrators to place fine-grained restrictions on scripts reducing the risk from malicious code. In addition, local scripts can now run on remote machines, and enhancements to the object model reduce the amount of boilerplate code needed when writing professional code. This overview of WSH 5.6 explains these changes and how .NET and scripting work together.

Dino Esposito

MSDN Magazine May 2002

Whistler: Build More Flexible Console Snap-ins with the MMC 2.0 Object Model


Microsoft Management Console (MMC) 2.0 provides a host of exciting new features for MMC users and snap-in developers. The new MMC 2.0 automation object model allows much of the user interface of MMC 2.0 to be accessed through script, and exposes events so that many tasks can now easily be automated. The new view extension model uses HTML to enable extensions to seamlessly integrate new user interfaces with those of existing snap-ins. MMC 2.0 also includes a specific view extension snap-in, the Extended View snap-in, which provides an interface similar to Web folders. Drag and drop support has been expanded, and console files now use the XML file format. Enhancements to console taskpads make it easier to accomplish tasks.

Vivek Jhaveri

MSDN Magazine March 2001

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend