[2016 Mar.Latest]Braindump2go Free 70-516 Exam Preparation Download 100% Pass 70-516 Exam

2016 March NEW 70-516 Exam Questions Released!

Exam Code: 70-516
Exam Name: TS: Accessing Data with Microsoft .NET Framework 4
Certification Provider: Microsoft
Corresponding Certifications: MCPD, MCPD: Web Developer 4, MCPD: Windows Developer 4, MCTS, MCTS: Microsoft .NET Framework 4, Data Access

2016 NEW 70-516 Study Guides:
1.Model data
2.Manage connections and context
3.Query data
4.Manipulate data
5.Develop and deploy reliable applications

QUESTION 271
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.
You define a Category class by writing the following code segment (Line numbers are included for reference only) Public Class Category
01 Public Class Category
02 Public Property CategorylDO As Integer
03 Get
04 End Get
05 Set
06 End Set
07 End Property
08 Public Property CategoryName() As String
09 Get
10 End Get
11 Set
12 End Set
13 End Property
14 Public Property Description() As String
15 Get
16 End Get
17 Set
18 End Set
19 End Property
20 Public Property Picture() As Byte()
21 Get
22 End Get
23 Set
24 End Set 25
26 End Property
You need to add a collection named Products to the Category class.
You also need to ensure that the collection supports deterred loading.
Which code segment should you insert at line 25?

A.    Public Shared Property Products() As List(Of Product)
Get End Get
Set
End Set
End Property
B.    Public Oweindabte Properly Products() As bst(Of Product)
Get End Get
Set
End Set
End Property
C.    Public UustOvemnde Properly Products() As bst (Of Produrt)
D.    Protected Property Products() As IJst(Of Product) Get End Get
Set
End Set
End Property

Answer: B

QUESTION 272
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)

QUESTION 273
Hotspot Question
You create an Entity Data Model (EDM) named ModelContoso.
You need to generate a Transact-SQL script to create a database to store ModelContoso.
The solution must ensure that table names are prefixed automatically with TBL_.
Which property of ModelContoso should you modify? (To answer, select the appropriate property in the answer area.)
 
Answer:
 

QUESTION 274
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create a Microsoft Windows Forms application,
You plan to deploy the application to several shared client computers.
You write the following code segment. (Line numbers are included for reference only.)
01 Dim config As Configuration = Conf igurationManager .OpenExeConf iguratlon(exeConf igName)
03 config.Save()
04 …
You need to encrypt the connection string stored in the .config file.
Which code segment should you insert at line 02?

A.    Dim section As ConnectionStringsSection _
TryCast(config.GetSection(“connectionString”),
ConnectionStringsSection)
section.Sectionlnformation.ProtectSection
(“DataProtectionConfigurationProvider”)
B.    Dim section As ConnectionStcingsSection =
TryCast(config.GetSecion(“connectionStrings”),
ConnectionStringsSection)section.
Sectionlnformation.ProtectSection
(“RsaProtectedConf igurationProvider”)
C.    Dim section As ConnectionStringsSection =
TryCast(config.GetSection(“connectionString”)
ConnectionStringsSection)
section.Sectionlnformation.ProtectSection
(“RsaProtectedConfigurationProvider”)
D.    Dim section As ConnectionStringsSection =
TryCast(config.GetSection(“connectionStrings”), ConnectionStringsSection)
section.Sectionlnformation.ProtectSection
(“DataProtectionConfigurationProvider”)

Answer: B
Explanation:
You encrypt and decrypt the contents of a Web.config file by using System.Configuration . DPAPIProtectedConfigurationProvider, which uses the Windows Data Protection API (DPAPI) to encrypt and decrypt data, or System.Configuration.
RSAProtectedConfigurationProvider, which uses the RSA encryption algorithm to encrypt and decrypt data. When you use the same encrypted configuration file on many computers in a Web farm, only System.Configuration.RSAProtectedConfigurationProvider enables you to export the
encryption keys that encrypt the data and import them on another server. This is the default setting.
CHAPTER 2 ADO.NET Connected Classes
Lesson 1: Connecting to the Data Store
Storing Encrypted Connection Strings in Web Applications (page 76)
Securing Connection Strings
(http://msdn.microsoft.com/en-us/library/89211k9b(v=vs.80).aspx)

QUESTION 275
Drag and Drop Question
You have an application that queries a Microsoft Access database.
The database contains a table named Tablel.
Tablel contains a column named Columnl.
A variable named Variablel is used to store a user input string.
You need to retrieve the rows from Tablel if the value in Columnl is equal to Variablel.
The solution must protect against a SQL injection attack.
What should you do? (Develop the solution by selecting and ordering the required code snippets. You may not need all of the code snippets.)
 
Answer:
 

QUESTION 276
You use Microsoft .NET Framework 4 to develop an application that connects to a Microsoft SQL Server 2008 database.
You add the following stored procedure to the database.
CREATE PROCEDURE GetSalesPeople
AS
BEGIN
SELECT FirstName, LastName, Suffix, Email, Phone
FROM SalesPeople
END
You write the following code. (Line numbers are included for reference only.)
01Dim connection As SqlConnection = New SqlConnection(“& “)
02Dim command As SqlCommand = New SqlCommand(“GetSalesPeople”, connection)
03command.CommandType = CommandType.StoredProcedure
You need to retrieve all of the results from the stored procedure.
Which code segment should you insert at line 04

A.    Dim res = command.ExecuteReader()
B.    Dim res = command.ExecuteScalar()
C.    Dim res = command.ExecuteNonQuery()
D.    Dim res = command.ExecuteXmlReader()

Answer: A
Explanation:
ExecuteReader Sends the CommandText to the Connection and builds a SqlDataReader.
SqlCommand Class
(http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.aspx)

QUESTION 277
Drag and Drop Question
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 have the following stored procedure:
 
You need to return a list of customers who match a given order date. The solution must meet the following requirements:
Use a forward-only data object.
Use a read-only data object.
What should you do? (To answer, drag the appropriate code segments to the correct locations. Each code segment may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.)
 
Answer:
 

QUESTION 278
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.)
01Public Function GetTextNodesForLocalization(doc As XDocument) As IEnumerable(Of XNode)
03Return From n In nodes _
04Where n.NodeType = XmlNodeType.Text _
05 Select n
06End Function
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 02?

A.    Dim nodes As IEnumerable(Of XNode) = doc.Descendants()
B.    Dim nodes As IEnumerable(Of XNode) = doc.Nodes()
C.    Dim nodes As IEnumerable(Of XNode) = doc.DescendantNodes()
D.    Dim nodes As IEnumerable(Of XNode) = doc.NodesAfterSelf()

Answer: C
Explanation:
DescendantNodes() Returns a collection of the descendant nodes for this document or element, in document order.
Descendants() Returns a collection of the descendant elements for this document or element, in
document order.
Nodes() Returns a collection of the child nodes of this element or document, in document order.
NodesAfterSelf() Returns a collection of the sibling nodes after this node, in document order.

QUESTION 279
Drag and Drop Question
You have a Cable named Tablel that contains two columns named Columnl and Column2. Columnl contains string data.
Column2 contains image files.
You create the following code:
 
What code should you use? (To answer, drag the appropriate elements to the correct locations. Each element may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.)
 
Answer:
 

QUESTION 280
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to develop an application. You use the ADO.NET Entity Framework Designer to model entities.
You need to associate a previously deserialized entity named personl to an object context named model and persist changes to the database.
Which code segment should you use?

A.    personl.AcceptChanges() model.SaveChanges()
B.    model.People.Attach(personl) model.SaveChanges()
C.    model.AttachTo(“People”, personl) model.SaveChanges()
D.    model.People.ApplyChanges(personl) model.SaveChanges()

Answer: C
Explanation:
Cosiderations from Attaching and Detaching objects
(http://msdn.microsoft.com/en-us/library/bb896271.aspx):
The object that is passed to the Attach method must have a valid EntityKey value.
If the object does not have a valid EntityKey value, use the AttachTo method to specify the name of the entity set.
Attach Use the Attach method of ObjectContext where the method accepts a single typed entity parameter.
AttachTo The AttachTo method of ObjectContext accepts two parameters.
The first parameter is a string containing the name of the entity set.
The second parameter’ type is object and references the entity you want to add.
Attach The Attach method of ObjectSet, which is the entity set’ type, accepts a single typed parameter containing the entity to be added to the ObjectSet.
CHAPTER 6 ADO.NET Entity Framework
Lesson 2: Querying and Updating with the Entity Framework
Attaching Entities to an ObjectContext(page 437)
Attaching and Detaching objects
(http://msdn.microsoft.com/en-us/library/bb896271.aspx)
http://msdn.microsoft.com/en-us/library/bb896248(v=vs.90).aspx
http://msdn.microsoft.com/en-us/library/bb896248.aspx

QUESTION 281
Drag and Drop Question
You are developing a Windows Forms application.
The application uses data from Microsoft SQL Server.
You have the following code:
 
You need to identify the connection pools used by connections and connection?
What should you identify? (To answer, drag the appropriate configurations to the correct connections pools. Each configuration m be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.)
 
Answer:
 

QUESTION 282
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 Entity Framework to access data.
You need to use Entity SQL to query data from an object of type ObjectContext.
Which method should you use first?

A.    ExecuteStoreCommand
B.    ExecuteStoreQuery
C.    CreateObject
D.    CreateQuery

Answer: D

QUESTION 283
Drag and Drop Question
You plan to generate the following Transact-SQL script from an Entity Data Model (EDM) by using the Entity Framework Designer:
 
You create an entity named Employee.
You need to identify the data types for the properties of the Employee entity.
What should you identify? (To answer, drag the appropriate data types to the correct statements. Each data type may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.)
 
Answer:
 

QUESTION 284
You u Microsoft `Visual Studio 2010 and Microsoft NET Framework 410 create a Windows Communication Foundation (`ACF) Data Services service
You deploy the service b the following URL http://contoso.comlNorthwtnd.svc.
You want to query the WCF Data Services service to retneve a list at customer objects
You need to ensure that the query meets the following requirements.
“Only customers that match the following filter criteria are retrieved City=Seatttle AND Level > 200 “Data sorted in ascending order by the ContactName arid Address properties.
Which URL should you use for the query’?

A.    http://contoso.comNorthwind.svc/Customers?City=SeattIe & Level gt 200 & Sordeby=ContactName,Address
B.    http://contoso.comNorthwind.svc/Customers?City=SeattIe & Level gt 200 & Sordeby=ContactName,Address
C.    http://contoso.comNorthwind.svc/Customers?City eq `Seattle aid Level gt 200 & Sordeby=ContactName,Address
D.    http://contoso.comNorthwind.svc/Customers?City eq `Seattle’ aid Level gt 200 & Sordeby=ContactName,Address

Answer: C

QUESTION 285
Drag and Drop Question
You are developing a Microsoft .NET Framework 4 application.
The application connects to a Microsoft SQL Server database.
You have the following stored procedure:
 
You have a custom class named CustomerDataContext that is derived from the DataContext class.
You need to use an instance of CustomerDataContext to update the database.
What code should you use? (To answer, drag the appropriate code segments to the correct locations. Each code segment may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.)
 
Answer:
 

QUESTION 286
Drag and Drop Question
You are developing a transactional application that debits customer accounts.
The application tracks account data in a local Microsoft SQL Server database and a web service.
You need to ensure that the transaction rolls back the operation in the local database and in the web service if an exception occurs.
What should you do? (To answer, drag the appropriate elements to the correct locations. Each element may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.)
 
Answer:



2016 NEW 70-516 Exam Questions & 70-516 Dumps PDF 286Q Full Version Free Shared by Braindump2go:http://www.braindump2go.com/70-516.html