PrepAway - Latest Free Exam Questions & Answers

Category: 70-573 (v.1)

Exam 70-573: TS: Microsoft SharePoint 2010, Application Development (update October 30th, 2015)

Which code segment should you add at line 11?

You have a document library named Documents. Minor and major version management is
enabled for the document library. You plan to add a document named MyFile.docx to Documents.
You create a console application that contains the following code segment. (Line numbers are
included for reference only.) 01 using (SPSite site = new SPSite(“http://intranet”)) 02 { 03 SPList
documents = site.RootWeb.Lists[“Documents”]; 04 FileStream fstream =
File.OpenRead(@”MyFile.docx”); 05 byte[] content = new byte[fstream.Length]; 06
fstream.Read(content, 0, (int)fstream.Length); 07 fstream.Close(); 08
site.RootWeb.Files.Add(documents.RootFolder.Url + “/MyFile.docx”, content, true); 09 SPFile file
= site.RootWeb.GetFile(documents.RootFolder.Url + “/MyFile. docx”); 10
file.CheckIn(string.Empty); 11 12 } You need to ensure that all users can see the document.

Which code segment should you add at line 11?

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?

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

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 site 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 0 6 generates an error. You need to ensure
that the .NET application displays the title of the SharePoint site in textBoxTitle. What should you
do?

Which code segment should you add at line 05?

You create a Web Part. You need to display the number of visits to a SharePoint site collection in
a label named LblVisits. You write the following code segment. (Line numbers are included for
reference only.) 01 SPSecurity.RuntfithElevatedPrivileges (delegate() 02 { 03 try 04 { 05 06
LblVisits.Text = site.Usage.Visits.ToString () ; 07 } 08 finally 09 { 10 11 } 12 } 13 ); Which code
segment should you add at line 05?

Which code segment should you add at line 02?

You need to create a Web Part that displays all of the content created by a specific user. You
write the following code segment. (Line numbers are included for reference only.) 01Dim
kRequest As New KeywordQuery(ServerContext.Current) 02 03kRequest.QueryText = strQuery
04Dim resultTbls As ResultTableCollection = kRequest.Execute() Which code segment should
you add at line 02?

Which URL should you choose?

You create two custom lists named Offices and Rooms. Rooms has the following columns: Title
Capacity Equipment Offices thas the following columns: Title Rooms (a lookup to the Title column
in the Rooms list) Rooms:Capacity Rooms:Equipment You need to perform a Representational
State Transfer (REST) query that returns a list of all the offices that have rooms with a capacity of
10. The query results must include the room titles and the equipment in each room. Which URL
should you choose?

You need to ensure that all users can use the Web Part to update the description of the current site

You create a Web Part that programmatically updates the description of the current SharePoint
site. The Web Part contains the following code segment. (Line numbers are included for reference

only.) 01 RunWithElevatedPrivileges(EvelateSub) 02 Private Sub ElevatedSub() 03 Dim currSite
As SPSite = SPContext.Current.Site 04 Dim currWeb As SPWeb = SPContext.Current.Web 05
Using eSite As New SPSite(currSite.ID) 06 Using eWeb As SPWeb =
eSite.OpenWeb(currWeb.ID) 07 eWeb.AllowUnsafeUpdates = True 08 currWeb.Description =
“Test” 09 currWeb.Update() 10 eWeb.AllowUnsafeUpdates = False 11 End Using 12 End Using
Users report that they receive an Access Denied error message when they use the Web Part. You
need to ensure that all users can use the Web Part to update the description of the current site.
What should you do?


Page 11 of 24« First...910111213...20...Last »