PrepAway - Latest Free Exam Questions & Answers

Category: 70-573

Exam 70-573: TS: Microsoft SharePoint 2010, Application Development

Which code element should you add at line 09?

You have a Microsoft .NET Framework console application that uses the SharePoint client object model.

The application contains the following code segment. (Line numbers are included for reference only.)

01 ClientContext cCtx = new ClientContext(“http://intranet/hr”);
02 List sharedDocList = cCtx.Web.Lists.GetByTitle(“Shared Documents”);
03 CamlQuery camlQuery = new CamlQuery();
04 camlQuery.ViewXml =
05 @”<View>
06 <Query>
07 <Where>
08 <Eq>
09
10 <Value Type=’Text’>Doc1.docx</Value>
11 </Eq>
12 </Where>
13 </Query>
14 </View>”;
15 ListItemCollection docLibItems = sharedDocList.GetItems(camlQuery);
16 cCtx.Load(sharedDocList);
17 cCtx.Load(docLibItems);
18 cCtx.ExecuteQuery();

You need to ensure that the application queries Shared Documents for a document named Doc1.docx.

Which code element should you add at line 09?

Which code segment should you add at line 09?

You have a SharePoint site collection that has the URL http://contoso/sites/finance.

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 ClientContext(“http://contoso/sites/finance”);
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?

What should you do?

You have a SharePoint Web application that has the URL http://intranet.

You are creating a Microsoft .NET Framework application that will display the title of the SharePoint Web application and will execute outside of the SharePoint server.

You create a textbox named textBoxTitle.

You write the following code segment. (Line numbers are included for reference only.)

01 ClientContext context = new ClientContext(“http://intranet”);
02
03 Web site = context.Web;
04 context.Load(site);
05
06 textBoxTitle.Text = site.Title;

You discover that line 04 generates an error.

You need to ensure that the .NET application displays the title of the SharePoint Web application in textBoxTitle.

What should you do?

Which method should you use?

You create a Microsoft .NET Framework console application that uses a Representational State Transfer (REST) API to query a custom list named Products.

The application contains the following code segment.

AdventureWorksDataContext codc = new AdventureWorksDataContext(new Uri(“http://contoso/_vti_bin/listdata.svc”));
codc.Credentials = CredentialCache.DefaultCredentials;

You need to read all items in Products into an object.

Which method should you use?

What should you do?

You create a Web Part.

The Web Part contains a grid view named GridView1 and the following code segment. (Line numbers are included for reference only.)

01 IntranetDataContext dc = new IntranetDataContext(“http://intranet”);
02 MyGridView.DataSource = from announce In dc.Announcements _ ;
03
04 Select announce IntranetDataContext is a LINQ context.

You need to ensure that GridView1 only displays items from Announcements that have an expiry date that is greater than or equal to the current date.

What should you do?

What should you do?

You have a SharePoint list named Assets that contains 1,000,000 items. The list contains a column named Urgent. Approximately 100 items have a value of True in their Urgent column.

You use the following line of code to retrieve the Assets list.

SPList assetsList = currentWeb.Lists[“assets”];

You need to retrieve all of the items in the list that have a value of True in their Urgent column. You must retrieve the items in the minimum amount of time.

What should you do?

Which code segment should you add at line 05?

You need to programmatically add a user named User1 to a group named Group1.

You write the following code segment. (Line numbers are included for reference only.)

01 string login = “User1”;
02 string grpName = “Group1”;
03 SPUser user = SPContext.Current.Web.EnsureUser(login);
04 SPGroup group = SPContext.Current.Web.Groups[grpName];
05
06 group.Update();

Which code segment should you add at line 05?


Page 10 of 18« First...89101112...Last »