Microsoft 70-516 ExamTS: Accessing Data with Microsoft .NET Framework 4

Total Question: 348 Last Updated: February 15,2017
  • Updated 70-516 Dumps
  • Based on Real 70-516 Exams Scenarios
  • Free 70-516 pdf Demo Available
  • Check out our 70-516 Dumps in a new PDF format
  • Instant 70-516 download
  • Guarantee 70-516 success in first attempt
Package Select:

Questions & Answers PDF

Practice Test Software

Practice Test + PDF 30% Discount

Price: $110.95 $55.95

Buy Now Free Trial
PDF Version Software Version

100% Guarantee on Products High Success Rate, supported by our 99.3% pass rate history and money back guarantee should you fail your exam.

Yes Yes

Updated regularly Get hold of Updated Exam Materials Every time. Free updates without any extra charges to the actual exam.

Yes Yes

70-516 PDF Questions & Answers Available in a universal Adobe PDF format. Portable and printable anywhere anytime.

Yes Yes

Quality and Value Exact Exam Questions with Correct Answers, verified by Experts with years of Experience in IT Field.

Yes Yes

Customizable Testing Engine Simulates a real world exam environment to prepare you for 70-516 Success.

Yes

Unlimited Practice 70-516 Exam Re-takes Practice Until you get it right. With options to Highlight missed questions, you can analyse your mistakes and prepare for Ultimate 70-516 Success.

Yes

Special Promotion More than 30% Discount for Royal Pack.

Yes

microsoft certification exam 70-516? Tips for success

We offer the 70-516 study guide pertaining to Microsoft Microsoft 70-516 exam preparation. It covers the major content material of Microsoft certification exam. The particular common customers can make complete preparations for the 70-516 exam. Microsoft Microsoft check braindumps will be probably the most definitive resource for you on the first attempt. Exambible Microsoft check engine will provide you with the most trustworthy, current, and genuine 70-516 study materials in Pdf forms. If you are a rookie, you can seek pertaining to help from the Microsoft study information step by step. You will be complete of confidence to look at the Microsoft Microsoft exam following preparing the idea according to the Microsoft certification practice questions. The downloadable Microsoft 70-516 Pdf questions and also answers are available and easy comprehending. Its quite simple in your case to use the free Pdf files.

2017 Jan sa-516-70 maximum allowable stress:

Q261. - (Topic 3) 

You use Microsoft .NET Framework 4 to create a data access layer component. 

The component will use an existing conceptual data model named Modell. Modell does not 

have an underlying database associated to it. 

You need to create an underlying database for Modell by using the least amount of code. 

Which tool should you use? 

A. Server Explorer 

B. Entity Framework Designer 

C. Entity Data Model Wizard 

D. Generate Database Wizard 

Answer:


Q262. - (Topic 3) 

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to develop an application that uses the Entity Framework. The application defines the following Entity Data Model. 

Within the .edmx file, the following function is defined. 

<Functlon Name-"Round" RetuEnType-"Decimal"> 

<Parametec Name-"val" Type-"Decimal" /> 

<DefiningExpression> CAST(val As Edm.Int32) 

</DefiningExpression> 

</Function> 

The application includes the following LINQ query. 

Dim query = From detail In context.SalesOrderDetails Select detail.LineTotal.Round() 

You need to ensure that the Round function executes on the database server when the query is executed. 

Which code segment should you use? 

A. Module DecimalHelper <EdmFunctlon("SqlServer", "Round")> <Extension()> Public Function Round(ByVal Amt As Decimal) As Decimal Throw New NotSupportedException() End Function End Module 

B. Module DecimalHelper <EdmFunction("Edm", "Round")> <Extension()> Public Function Round(ByVal Amt As Decimal) As Decimal Throw New NotSupportedException() End Function End Module 

C. Module DecimalHelper <Extension()> Public Function Round( ByVal input As Decimal) As SqlDecimal Return SqlDecimal.Round(input/ 0) End Function End Module 

D. Module PecimalHelper <Extension()> Public Function Round(ByVal Input As Decimal) As Decimal Return Convert.ToDeclroal(Convert.ToInt32(Input)) End Function End Module 

Answer:

Explanation: 

EdmFunctionAttribute Class (http://msdn.microsoft.com/en-us/library/system.data.objects.dataclasses.edmfunctionattribute.aspx) How to: Call Model-Defined Functions in Queries (http://msdn.microsoft.com/en-us/library/dd456857.aspx) The model-defined function has been created in the conceptual model, but you still need a way to connect your code to it. To do so, add a function into your C# code, which will have to be annotated with the EdmFunctionAttribute attribute. This function can be another instance method of the class itself, but best practice is to create a separate class and define this method as static. 


Q263. - (Topic 1) 

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to develop an application that will access a WCF data service. The solution contains the projects shown in the following table. 

The WCF data service exposes an Entity Framework model. 

You need to access the service by using a WCF Data Services client. 

What should you do in the Application.Client project? 

A. Add a reference to the Application.Model project. 

B. Add a reference to the Application.Service project. 

C. Add a service reference that uses the URL of the WCF data service. 

D. Add a Web reference that uses the URL of the WCF data service. 

Answer:


Q264. - (Topic 3) 

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 use the ADO.NET Entity Framework to model your entities. You use ADO.NET self-tracking entities. 

You need to ensure that the change-tracking information for the self-tracking entities can be used to update the database. 

Which ObjectContext method should you call after changes are made to the entities? 

A. Attach 

B. SaveChanges 

C. ApplyChanges 

D. Refresh 

Answer:

Explanation: 

ApplyChanges takes the changes in a connected set of entities and applies them to an ObjectContext. 

Starting with Microsoft Visual Studio 2010, the ADO.NET Self-Tracking Entity Generator template generates self-tracking entities. This template item generates two .tt (text template) files: <model name>.tt and <model name>.Context.tt. The <model name>.tt file generates the entity types and a helper class that contains the change-tracking logic that is used by self-tracking entities and the extension methods that allow setting state on self-tracking entities. The <model name>.Context.tt file generates a typed ObjectContext and an extension class that contains ApplyChanges methods for the ObjectContext and ObjectSet classes. These methods examine the change-tracking information that is contained in the graph of self-tracking entities to infer the set of operations that must be performed to save the changes in the database. Working with Self-Tracking Entities (http://msdn.microsoft.com/en-us/library/ff407090.aspx) 


Q265. - (Topic 3) 

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 has two DataTable objects that reference the Customers and Orders tables in the database. 

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

01 Dim customerOrders As New DataSet() 

02 customerOrders.EnforceConstraints = True 

03 Dim ordersFK As New ForeignKeyConstraint("ordersFK", 

04 customerOrders.Tables("Customers").Columns("CustomerID"), 

05 customerOrders.Tables("Orders").Columns("CustomerID")) 

07 customerOrders.Tables("Orders").Constraints.Add(ordersFK) 

You need to ensure that an exception is thrown when you attempt to delete Customer records that have related Order records. 

Which code segment should you insert at line 06? 

A. ordersFK.DeleteRule = Rule.SetDefault 

B. ordersFK.DeleteRule = Rule.None 

C. ordersFK.DeleteRule = Rule.SetNull 

D. ordersFK.DeleteRule = Rule.Cascade 

Answer:

Explanation: 

None No action taken on related rows, but exceptions are generated. 

Cascade Delete or update related rows. This is the default. 

SetNull Set values in related rows to DBNull. 

SetDefault Set values in related rows to the value contained in the DefaultValue property. 

SetDefault specifies that all child column values be set to the default value. 

CHAPTER 1 ADO.NET Disconnected Classes 

Lesson 1: Working with the DataTable and DataSet Classes 

Cascading Deletes and Cascading Updates (page 26) 


Improved self paced training kit 70-516:

Q266. - (Topic 3) 

You use Microsoft Visual Studio 2010 and Microsoft ADO.NET Framework 4 to create an application. The application connects to a Microsoft SQL Server 2008 database. 

You use the ADO.NET LINQ to SQL model to retrieve data from the database. You use stored procedures to return multiple result sets. 

You need to ensure that the result sets are returned as strongly typed values. 

What should you do? 

A. Apply the FunctionAttribute and ResultTypeAttribute to the stored procedure function. Use the GetResult<TElement> method to obtain an enumerator of the correct type. 

B. Apply the FunctionAttribute and ParameterAttribute to the stored procedure function and directly access the strongly typed object from the results collection. 

C. Apply the ResultTypeAttribute to the stored procedure function and directly access the strongly typed object from the results collection. 

D. Apply the ParameterAttribute to the stored procedure function. Use the GetResult<TElement> method to obtain an enumerator of the correct type. 

Answer:

Explanation: 

You must use the IMultipleResults.GetResult<TElement> Method pattern to obtain an 

enumerator of the correct type, based on your knowledge of the stored procedure. 

FunctionAttribute Associates a method with a stored procedure or user-defined function in 

the database. 

IMultipleResults.GetResult<TElement> Method 

(http://msdn.microsoft.com/en-us/library/bb534218.aspx) 


Q267. - (Topic 4) 

Refer to the following lines in the case study: PA42 in \\Model\\Part.vb, PR16 in \\Model\\Product.vb, and CT14 in \\Model\\Component.vb. 

The application must create XML files that detail the part structure for any product. The XML files must use the following format: 

<?xml version="1.0" encoding="utf-8"?> 

<product name="Brush" description="Brush product" productType="1"> 

<component name="Handle" description="Handle" partType="2"> 

<component name="Screw" description="Screw" partType="3" /> 

<component name="Wood" description="Wooden shaft" partType="45" /> 

</component> 

<component name="Head" description="Head" partType="5"> 

<component name="Screw" description="Screw" partType="3" /> 

<component name="Bristles" description="Bristles" partType="4" /> 

</component></product> 

You need to update the application to support the creation of an XElement object having a structure that will serialize to the format shown above. 

What should you do? (Each correct answer presents part of the solution. Choose two.) 

A. Insert the following code segment at line PR16 in \\Model\\Product.cs: 

return new XElement("product, new XAttribute("name", this.Name), 

new XElement("description", this.Description), 

new XElement("productType", this.ProductType)); 

B. Insert the following code segment at line CT14 in \\Model\\Component.cs: 

return new XElement("component, new XElement("name", this.Name), 

new XElement("description", this.Description), 

new XElement("partType", this.PartType)); 

C. Insert the following code segment at line PR16 in \\Model\\Product.cs: 

return new XElement("product, new XElement("name", this.Name), 

new XElement("description", this.Description), 

new XElement("productType", this.ProductType)); 

D. Insert the following code segment at line PR16 in \\Model\\Product.cs: 

return new XElement("product, new XAttribute("name", this.Name), 

new XAttribute("description", this.Description), 

new XAttribute("productType", this.ProductType)); 

E. Insert the following code segment at line CT14 in \\Model\\Component.cs: 

return new XElement("component, new XAttribute("name", this.Name), 

new XElement("description", this.Description), 

new XElement("partType", this.PartType)); 

F. Insert the following code segment at line CT14 in \\Model\\Component.cs: 

return new XElement("component, new XAttribute("name", this.Name), 

new XAttribute("description", this.Description), 

new XAttribute("partType", this.PartType)); 

Answer: D,F 

340. - (Topic 4) 

You add a table to the database to track changes to part names. The table stores the following row values: 

the username of the user who made the change 

a part ID 

the new 

part name 

a DateTime value 

You need to enable detection of unauthorized changes to the row values. 

You also need to ensure that database users can view the original row values. 

What should you do? 

A. Add a column named signature. 

Use System.Security.Cryptography.RSA to create a signature for all of the row values. 

Store the signature in the signature column. Publish only the public key internally. 

B. Add a column named hash. 

Use System.Security.Cryptography.MD5 to create an MD5 hash of the row values, and 

store in the hash column. 

C. Use System.Security.Cryptography.RSA to encrypt all the row values. Publish only the 

key internally. 

D. Use System.Security.Cryptography.DES to encrypt all the row values using an 

encryption key held by the application. 

Answer:


Q268. - (Topic 5) 

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. The application uses the ADO.NET Entity Framework to model entities. The application allows users to make changes while disconnected from the data store. Changes are submitted to the data store by using the SubmitChanges method of the DataContext object. 

You receive an exception when you call the SubmitChanges method to submit entities that a user has changed in offline mode. 

You need to ensure that entities changed in offline mode can be successfully updated in the data store. 

What should you do? 

A. Set the ObjectTrackingEnabled property of DataContext to true. 

B. Set the DeferredLoadingEnabled property of DataContext to true. 

C. Call the SaveChanges method of DataContext with a value of false. 

D. Call the SubmitChanges method of DataContext with a value of System.Data.Linq.ConflictMode. ContinueOnConflict. 

Answer:

Explanation: 

ObjectTrackingEnabled Instructs the framework to track the original value and object identity for this DataContext. 

ObjectTrackingEnabled Property (http://msdn.microsoft.com/en-us/library/system.data.linq.datacontext.objecttrackingenabled.aspx) 


Q269. - (Topic 3) 

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an 

application. 

You are creating the data layer of the application. 

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

01Public Shared Function GetDataReader(sql As String) As SqlDataReader 

02Dim dr As SqlDataReader = Nothing 

04Return dr 05End Function 

You need to ensure that the following requirements are met: The SqlDataReader returned by the GetDataReader method can be used to retrieve rows from the database. 

SQL connections opened within the GetDataReader method will close when the SqlDataReader is closed. 

Which code segment should you insert at line 03? 

A. Using cnn As New SqlConnection(strCnn) 

Try 

Dim cmd As New SqlCommand(sql, cnn) 

cnn.Open() 

dr = cmd.ExecuteReader() 

Catch 

Throw 

End Try 

End Using 

B. Dim cnn As New SqlConnection(strCnn) 

Dim cmd As New SqlCommand(sql, cnn) 

cnn.Open() 

Try 

dr = cmd.ExecuteReader() 

Finally 

cnn.Close() 

End Try 

C. Dim cnn As New SqlConnection(strCnn) 

Dim cmd As New SqlCommand(sql, cnn) 

cnn.Open() 

Try 

dr = cmd.ExecuteReader() 

cnn.Close() 

Catch 

Throw 

End Try 

D. Dim cnn As New SqlConnection(strCnn) 

Dim cmd As New SqlCommand(sql, cnn) 

cnn.Open() 

Try 

dr = cmd.ExecuteReader(CommandBehavior.CloseConnection) 

Catch 

cnn.Close() 

Throw 

End Try 

Answer: D Explanation: 

CommandBehavior.CloseConnection When the command is executed, the associated Connection object is closed when the associated DataReader object is closed. CommandBehavior Enumeration (http://msdn.microsoft.com/en-us/library/system.data.commandbehavior.aspx) SqlCommand.ExecuteReader Method (CommandBehavior) (http://msdn.microsoft.com/en-us/library/y6wy5a0f.aspx) 


Q270. - (Topic 2) 

You add a table to the database to track changes to part names. The table stores the following row values: The username of the user who made the change a part ID the new part name a DateTime value 

You need to enable detection of unauthorized changes to the row values. You also need to ensure that database users can view the original row values. 

What should you do? 

A. Add a column named signature. Use System.Security.Cryptography.RSA to create a signature for all of the row values. Store the signature in the signature column. Publish only the public key internally. 

B. Add a column named hash. Use System.Security.Cryptography.MD5 to create an MD5 hash of the row values, and store the hash in the hash column. 

C. Use System.Security.Cryptography.DES to encrypt all the row values using an encryption key held by the application. 

D. Use System.Security.Cryptography.RSA to encrypt all the row values. Publish only the public key internally. 

Answer:


Related 70-516 Articles