PrepAway - Latest Free Exam Questions & Answers

Tag: Exam 70-516 (update October 26th, 2015)

Exam 70-516: TS: Accessing Data with Microsoft .NET Framework 4 (update October 26th, 2015)

Which code segment should you insert at line 03?

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. The
application contains the following XML document.
< feed >
< title > Products < /title >
< entry >
< title > Entry title 1 < /title >
< author > Author1 < /title >
< content >
< properties >
< description > some description < /description >
< n otes > some notes < /notes >
< comments > some comments < /comments >
< /properties >
< /content >

< /entry >

< /feed >
You plan to add localization features to the application.
You add the following code segment. (Line numbers are included for reference only.)
01 public IEnumerable < XNode > GetTextNodesForLocalization(XDocument doc)
02 {
03
04 return from n in nodes
05 where n.NodeType == XmlNodeType.Text
06 select n;
0 7 }
You need to ensure that the GetTextNodesForLocalization method returns all the XML text nodes of
the document. Which code segment should you insert at line 03?

You need to ensure that the actual exception data is provided to client computers

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. You
deploy a Windows Communication Foundation (WCF) Data Service to a production server. The
application is hosted by Internet Information Services (IIS). After deployment, applications that
connect to the service receive the following error message:
“The server encountered an error processing the request. See server logs for more details.”
You need to ensure that the actual exception data is provided to client computers.
What should you do?

Which code segment should you insert at line 06?

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. The
application connects to a Microsoft SQL Server database. You create a DataSet object in the
application. You add two DataTable objects named App_Products and App_Categories to the
DataSet. You add the following code segment to populate the DataSet object. (Line numbers are
included for reference only.)
01 public void Fill(SqlConnection cnx, DataSet ds) {
03 var cmd = cnx.CreateCommand();
04 cmd.CommandText = “SELECT * FROM dbo.Products; ” + “SELECT * FROM dbo.Categories”;
05 var adapter = new SqlDataAdapter(cmd);
06
07 }
You need to ensure that App_Products and App_Categories are populated from the dbo.Products
and dbo. Categories database tables. Which code segment should you insert at line 06?

You need to ensure that the application calls a stored procedure that accepts a table-valued parameter

You use Microsoft Visual Studio 2010 and Microsoft NET Framework 4 to create an application. The
application connects to a Microsoft SQL Server 2008 database. You need to ensure that the
application calls a stored procedure that accepts a table-valued parameter. You create a
SqlParameter object. What should you do next?

Which URL should you use for the query?

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create a Windows
Communication Foundation (WCF) Data Services service. You deploy the service to the following
URL: http://contoso.com/ Northwind.svc. You want to query the WCF Data Services service to
retrieve a list of customer objects. You need to ensure that the query meets the following
requirements:
• “Only customers that match the following filter criteria are retrieved: City=”Seattle” AND Level >
200.
• “Data is sorted in ascending order by the ContactName and Address properties.
Which URL should you use for the query?

Which code segment should you use?

You use Microsoft .NET Framework 4 to develop an application that uses LINQ to SQL. You create a
data model named AdvWorksDataContext, and you add the Product table to the data model. The
Product table contains a decimal column named ListPrice and a string column named Color. You
need to update the ListPrice column where the product color is Black or Red. Which code segment
should you use?

Which code segment should you insert at line 02?

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. The
application connects to a Microsoft SQL Server database. The application uses a DataTable named
OrderDetailTable that has the following columns:
• ID
• OrderID

• ProductID
• Quantity
• LineTotal
Some records contain a null value in the LineTotal field and 0 in the Quantity field. You write the
following code segment. (Line numbers are included for reference only.)
01DataColumn column = new DataColumn(“UnitPrice”, typeof(double));
02
03OrderDetailTable.Columns.Add(column);
You need to add a calculated DataColumn named UnitPrice to the OrderDetailTable object. You also
need to ensure that UnitPrice is set to 0 when it cannot be calculated. Which code segment should
you insert at line 02?

You need to ensure that the database script that is created by using the Generate Database From Model option m

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to develop an application.
You use the Entity Framework Designer to create an Entity Data Model using model-first
development. The database has the following requirements:
• Each table must have a datetime column named time_modified.
• Each table requires a trigger that updates the value of the time_modified column when a
row is inserted or updated.
You need to ensure that the database script that is created by using the Generate Database From
Model option meets the requirements. What should you do?


Page 6 of 31« First...45678...2030...Last »