[Free] New Updated (October) Microsoft 70-516 Real Exam 191-200

Ensurepass

 

QUESTION 191

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)

 

02

 

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”)

 

Correct 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 192

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 need to ensure that the model and mapping files are not deployed as application resources.

 

What should you do?

 

A.

Modify the connection string in the applications .config file to refer to the absolute physical path to the .edmx file.

B.

Modify the connection string in the applications .config file to refer to the relative path to the .edmx file.

C.

Set the value of the .edmx file’s Metadata Artifact Processing property to Copy to Output Directory.

D.

Set the value of the .edmx files Build Action property to Copy to Output.

 

Correct Answer: C

 

 

QUESTION 193

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to develop an ASP.NET Web application that uses the Entity Framework.

 

The build configuration is set to Release. The application must be published by using Microsoft Visual Studio 2010, with the following requirements:

 

clip_image002The database schema must be created on the destination database server.

clip_image002[1]The Entity Framework connection string must be updated so that it refers to the destination database server.

 

You need to configure the application to meet the requirements.

 

Which two actions should you perform?(Each correct answer presents part of the solution. Choose two.)

 

A.

Generate the DDL from the Entity Framework Designer and include it in the project. Set the action for the DDL to ApplicationDefinition.

B.

Set Items to deploy in the Package/Publish Web tab to All files in this Project Folder for the release configuration.

C.

Use the web.config transform file to modify the connection string for the release configuration.

D.

Include the source database entry in the Package/Publish SQL tab and update the connection string for the destination database.

 

Correct Answer: CD

 

 

QUESTION 194

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 the following object query to load a product from the database. (Line numbers are included for reference only.)

 

01 Using advWorksContext As New AdventureWorksEntities()

 

02 Dim productQuery As ObjectQuery(Of Product) =

 

03 advWorksContext.Product.Where(“it.ProductID = 900”)

 

04

 

05 End Using

 

You need to log the command that the query executes against the data source.

 

Which code segment should you insert at line 04?

 

A.

Trace.WriteLine(productQuery.ToString())

B.

Trace.WriteLine(productQuery.ToTraceString())

C.

Trace.WriteLine(productQuery.CommandText)

D.

Trace.WriteLine((DirectCast(productQuery, IQueryable)).Expression)

 

Correct Answer: B

Explanation:

CHAPTER 8 Developing Reliable Applications

Lesson 1: Monitoring and Collecting Performance Data Accessing SQL Generated by the Entity Framework (page 509)

 

 

 

 

 

 

 

QUESTION 195

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. The application contains the following XML document.

 

<bib>

 

<book title=”TCP/IP Illustrated” year=”1994″>

 

<author> Author1 </author>

 

</book>

 

<book title=”Programming in Unix” year=”1992″>

 

<author> Author1 </author>

 

<author> Author2 </author>

 

<author> Author3 </author>

 

</book>

 

<book title=”Data on the Web” year=”2000″>

 

<author> Author4 </author>

 

<author> Author3 </author>

 

</book>

 

</bib>

 

You add the following code fragment. (Line numbers are included for reference only.)

 

01 Public Function GetBooks(xml As String) As IEnumerable(Of XElement)

 

02 Dim doc As XDocument = XDocument.Parse(xml)

 

03

 

04 End Function

 

You need to return a list of book XML elements that are authored by Author1.

 

Which code segment should you insert at line 03?

 

A.

Return Document.Element(“bib”)

.Elements() .SelectMany(Function(e1 As) e1.Elements()

.Where(Function(e2 As) e2.Equals(New XElement(“author”, “Author1”))))

B.

Return Document.Element(“bib”)

.Elements().SelectMany(Function(e1 As) e1.Elements()

.Where(Function(e2 As) DirectCast(e2, String) = “Author1”))

C.

Return Document.Element(“bib”)

.Elements()

.Where(Function(e1 As) e1.Elements().Any(Function(e2 As) DirectCast(e2, String) = “Author1”))

D.

Return Document.Element(“bib”)

.Elements()

.Where(Function(e1 As) e1.Elements().Any(Function(e2 As) e2.Equals(New XElement(“author”, “Author1”))))

 

Correct Answer: C

 

 

QUESTION 196

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to develop an application that uses LINQ to SQL. The application contains the following model.

 

clip_image003

 

Each region contains a single vendor. Customers order parts from the vendor that is located in their region.

 

You need to ensure that each row in the Customer table references the appropriate row from the Vendor table.

 

Which code segment should you use?

 

A.

Dim dc As SalesDataContext = New SalesDataContext( “…” )

Dim query = From c In dc.Customers

Join v In dc.Vendors On c.Region Equals v.Region

Select New With {.Customer = c, -Vendor = v}

For Each u In query

B.

Vendor.VendorlD = u.Customer.VendorlD

Next

dc.SubmitChanges()

C.

Dim dc As SalesDataContext – New SalesDataContext ( “…” )

Dim query = From v In dc.Vendors

Join c In dc.Customers On v.Region Equals c.Region

Select New With {.Vendor = v, -Customer = c>

For Each u In query

D.

Customer.VendorID = u.Vendor.VendorID

Next

dc.SubmitChanges()

E.

Dim dc As SalesDataContext = New SalesDataContext( “…” )

Dim query = From c In dc.Customers

Join v In dc.Vendors On c.VendorID Equals v.VendorID

Select New With {.Customer = c, -Vendor = v)

For Each u In query

F.

Vendor.Region = u.Customer.Region

Next

dc.SubmitChanges()

G.

Dim dc As SalesDataContext – New SalesDataContext( “…”)

Dim query = From v In dc.Vendors

Join c In dc.Customers On v.VendorID Equals c.VendorID

Select New With {.Vendor = v, .Customer = c}

For Each u In query

H.

Customer.Region = u.Vendor.Region

Next

dc.SubmitChanges()

 

Correct Answer: B

 

 

QUESTION 197

You use Microsoft .NET Framework 4 to develop an application that connects to a Microsoft SQL Server 2008 database by using SQL Server authentication.

 

The application contains the following connection string.

 

SERVER=DBSERVER-01; DATABASE=pubs; uid=sa; pwd=secret;

 

You need to ensure that the password value in the connection string property of a SqlConnection object does not exist after the Open method is called.

 

What should you add to the connection string?

 

A.

Persist Security Info=True

B.

Trusted_Connection=True

C.

Persist Security Info=False

D.

Trusted_Connection=False

 

Correct Answer: C

Explanation:

The Persist Security Info property specifies whether the data source can persist sensitive authentication information such as a password.

Persist Security Info Property

http://msdn.microsoft.com/en-us/library/aa214039(v=sql.80).aspx

 

 

QUESTION 198

You use Microsoft .NET Framework 4 and the Entity Framework to develop an application. You create an Entity Data Model that has an entity named Customer. You set the optimistic concurrency option for Customer. You load and modify an instance of Customer named loadedCustomer, which is attached to an ObjectContext named context.

 

You need to ensure that if a concurrency conflict occurs during a save, the application will load up-to-date values from the database while preserving local changes.

 

Which code segment should you use?

 

A.

Try

context.SaveChanges()

Catch ex As EntitySqlException

context.Refresh

(RefreshHode.StoreWins, loadedCustomer)

End Try

B.

Try

context.SaveChanges()

Catch ex As OptimisticConcurrencyException

context.Refresh(RefreshMode.ClientWins, loadedCustomer)

End Try

C.

Try

context.SaveChanges()

Catch ex As EntitySqlException

context.Refresh(RefreshMode.ClientWins, loadedCustomer)

End Try

D.

Try

context.SaveChanges()

Catch ex As OptimisticConcurrencyException

context.Refresh(RefreshHode.StoreWins, loadedCustomer)

End Try

 

Correct Answer: B

Explanation:

EntitySqlException Represents errors that occur when parsing Entity SQL command text. This exception is thrown when syntactic or semantic rules are violated.

System.Object

System.Exception

System.SystemException

System.Data.DataException

System.Data.EntityException

System.Data.EntitySqlException

OptimisticConcurrencyException The exception that is thrown when an optimistic concurrency violation occurs.

System.Object

System.Exception

System.SystemException

System.Data.DataException

System.Data.UpdateException

System.Data.OptimisticConcurrencyException

Optimistic Concurrency (ADO.NET)

http://msdn.microsoft.com/en-us/library/aa0416cz.aspx

http://msdn.microsoft.com/en-us/library/system.data.objects.refreshmode.aspx

http://msdn.microsoft.com/en-us/library/bb738618.aspx

 

 

QUESTION 199

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.

 

clip_image004

 

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.

 

Correct Answer: C

 

 

QUESTION 200

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to develop an application that uses the Entity Framework. The appl cat on has an entity model that contains a SalesOrderHeader entity. The entity includes an OrderDate property of type DateTime.

 

You need to retrieve the 10 oldest SalesOrderHeaders according to the OrderDate property.

 

Which code segment should you use?

 

clip_image005

 

A.

Option A

B.

Option B

C.

Option C

D.

Option D

 

Correct Answer: D

Free VCE & PDF File for Microsoft 70-516 Real Exam

Instant Access to Free VCE Files: MCSE|MCSA|MCITP…
Instant Access to Free PDF Files: MCSE|MCSA|MCITP…