nerdexam
Microsoft

70-573 · Question #39

You are creating a Microsoft .NET Framework console application that will use the SharePoint client object model to create a site in the site collection. The application contains the following code…

The correct answer is B. cCtx.ExecuteQuery (). MNEMONIC RULE: "Execute your Query" Executes the current set of data retrieval queries and method invocations. How to: Work with Web Sites

Developing for Client Applications

Question

You are creating a Microsoft .NET Framework console application that will use the SharePoint client object model to create a site in the site collection. The application contains the following code segment. (Line numbers are included for reference only.) 01 ClientContext cCtx = new 02 Web root = cCtx.Site.RootWeb; 03 cCtx.Load(root); 04 WebCreationInformation webInfo = new WebCreationInformation(); 05 webInfo.Title = "site1"; 06 webInfo.Url = "site1"; 07 webInfo.WebTemplate = "MPS#2"; 08 root.Webs.Add(webInfo); 09 10 cCtx.Dispose(); You need to ensure that the application creates the site. Which code segment should you add at line 09?

Options

  • AcCtx.Site.RootWeb.Update ();
  • BcCtx.ExecuteQuery ();
  • Croot.Context.Dispose ();
  • Dcoot.Update ();

How the community answered

(33 responses)
  • A
    9% (3)
  • B
    85% (28)
  • C
    3% (1)
  • D
    3% (1)

Explanation

MNEMONIC RULE: "Execute your Query" Executes the current set of data retrieval queries and method invocations. How to: Work with Web Sites

Topics

#client object model#ExecuteQuery#ClientContext#site creation

Community Discussion

No community discussion yet for this question.

Full 70-573 Practice