Microsoft CertifyMe 70-521 v2011-10-03 118q By-Errebh

43
Microsoft_ CertifyMe_70-521_v2011-10-03_118q_By-Errebh Number : 70-521 Passing Score : 800 Time Limit : 120 min File Version : 52.2 http://www.gratisexam.com/ Pass Microsoft 70-521 Exam Exam Name:Trans MCPD.NET Frmwk 3.5 Dev Skil to .NET 4 Windows App Developer

Transcript of Microsoft CertifyMe 70-521 v2011-10-03 118q By-Errebh

Page 1: Microsoft CertifyMe 70-521 v2011-10-03 118q By-Errebh

Microsoft_ CertifyMe_70-521_v2011-10-03_118q_By-Errebh

Number: 70-521Passing Score: 800Time Limit: 120 minFile Version: 52.2

http://www.gratisexam.com/

Pass Microsoft 70-521 Exam

Exam Name:Trans MCPD.NET Frmwk 3.5 Dev Skil to .NET 4 Windows App Developer

Page 2: Microsoft CertifyMe 70-521 v2011-10-03 118q By-Errebh

Actual-Exams

QUESTION 1You are creating a Windows Communication Foundation (WCF) service that is implemented as follows. (Linenumbers are included for reference only.) 01 <ServiceContract()> 02 <ServiceBehavior(IncludeExceptionDetailInFaults:=True)> 03 Public Class OrderService 04 05 <OperationContract()> 06 PublicSub SubmitOrder(ByVal anOrder As Order) 07 08 Try 09 ... 10 Catch ex As DivideByZeroException 11 12 EndTry 13 End Sub 14 15 End Class You need to ensure that the stack trace details of the exception are notincluded in the error information sent to the client. What should you do?

A. Replace line 11 with the following line. ThrowB. Replace line 11 with the following line. Throw New FaultException(Of Order)(anOrder, ex.ToString())C. After line 05, add the following line. <FaultContract(GetType(FaultException(Of Order)))> Replace line 11

with the following line. Throw exD. After line 05, add the following line. <FaultContract(GetType(FaultException(Of Order)))> Replace line 11

with the following line. Throw New FaultException(Of Order)( anOrder, "Divide by zero exception")

Correct Answer: DSection: (none)Explanation

Explanation/Reference:

QUESTION 2You are creating a Windows Communication Foundation (WCF) service. You do not want to expose the internalimplementation at the service layer. You need to expose the following class as a service named Arithmetic withan operation named Sum. Public Class Calculator Public Function Add(ByVal x As Integer, ByVal y As Integer)As Integer End Function End Class Which code segment should you use?

A. <ServiceContract(Namespace:="Arithmetic")> Public Class Calculator <OperationContract(Action:="Sum")>Public Function Add(ByVal x As Integer, ByVal y As Integer) As Integer ... End Function End Class

B. <ServiceContract(ConfigurationName:="Arithmetic")> Public Class Calculator <OperationContract(Action:="Sum")> Public Function Add(ByVal x As Integer, ByVal y As Integer) As Integer ... End FunctionEnd Class

C. <ServiceContract(Name:="Arithmetic")> Public Class Calculator <OperationContract(Name:="Sum")>Public Function Add(ByVal x As Integer, ByVal y As Integer) As Integer ... End Function End Class

D. <ServiceContract(Name:="Arithmetic")> Public Class Calculator <OperationContract(ReplyAction:="Sum")>Public Function Add(ByVal x As Integer, ByVal y As Integer) As Integer ... End Function End Class

Correct Answer: CSection: (none)Explanation

Explanation/Reference:Lead your way to certificates!

QUESTION 3A Windows Communication Foundation (WCF) application uses a data contract that has several datamembers. You need the application to throw a SerializationException if any of the data members are notpresent when a serialized instance of the data contract is deserialized.

Page 3: Microsoft CertifyMe 70-521 v2011-10-03 118q By-Errebh

What should you do?

A. Add the KnownType attribute to the data contract. Set a default value in each of the data memberdeclarations.

B. Add the KnownType attribute to the data contract. Set the Order property of each data member to uniqueinteger value.

C. Set the EmitDefaultValue property of each data member to False.D. Set the IsRequired property of each data member to True.

Correct Answer: DSection: (none)Explanation

Explanation/Reference:

QUESTION 4.You are creating a Windows Communication Foundation (WCF) service that implements operations in aRESTful manner. You need to add a delete operation. You implement the delete method as follows. SubDeleteItems(ByVal id As String) You need to configure WCF to call this method when the client calls the servicewith the HTTP DELETE operation. What should you do?

A. Add the WebInvoke(UriTemplate:="/Items/{id}", Method:="DELETE") attribute to the operation.B. Add the HttpDelete attribute to the operation.C. Replace the string parameter with a RemovedActivityAction parameter.D. Change the Sub statement to Function and specify RemovedActivityAction as the return type.

Correct Answer: ASection: (none)Explanation

Explanation/Reference:

QUESTION 5.You are building a client for a Windows Communication Foundation (WCF) service. You need to create a proxyto consume this service. Which class should you use?

A. ChannelFactory(Of TChannel)B. ServiceHostC. ClientRuntimeD. CommunicationObject

Correct Answer: ASection: (none)Explanation

Explanation/Reference:

Page 4: Microsoft CertifyMe 70-521 v2011-10-03 118q By-Errebh

http://www.gratisexam.com/

QUESTION 6.You are consuming a Windows Communication Foundation (WCF) service in an ASP.NET Web application.The service interface is defined as follows. <ServiceContract()> Public Interface ICatalog <OperationContract()> <WebGet(UriTemplate:="/Catalog/Items/{id}", ResponseFormat:=WebMessageFormat.Json)> FunctionRetrieveItemDescription(ByVal id As Integer) As String End Interface The service is hosted at /Catalog.svc. Youneed to call the service using jQuery to retrieve the description of an item as indicated by a variable nameditemId. Which code segment should you use?

A. $.get(String.format("/Catalog.svc/Catalog/Items/?id={0}", itemId) null, function (data) { ... }, "javascript")?B. $.get(String.format("/Catalog.svc/Catalog/Items/{0}", itemId), null, function (data) { ... }, "json")?C. $.get(String.format("/Catalog.svc/Catalog/Items/{0}", itemId), null, For interactive and self-paced preparation

of exam 70-521, try our practice exams.Practice exams also include self assessment and reporting features! function (data) { ... }, "xml")?

D. $.get(String.format("/Catalog.svc/Catalog/Items/id={0}", itemId), null, function (data) { ... }, "json")?

Correct Answer: BSection: (none)Explanation

Explanation/Reference:

QUESTION 7.You are developing an application to update a user's social status. You need to consume the service usingWindows Communication Foundation (WCF). The client configuration is as follows. <system.serviceModel><bindings> <webHttpBinding> <binding name="SocialConfig"> <security mode="TransportCredentialOnly"><transport clientCredentialType="Basic" ?realm="Social API" /> </security> </binding> </webHttpBinding> </bindings> <client> <endpoint address="http://contoso.com"

Lead your way to certificates!

binding="webHttpBinding" bindingConfiguration="SocialConfig" contract="ISocialStatus" name="SocialClient" /></client> </system.serviceModel> The service contract is defined as follows. <ServiceContract()> PublicInterface ISocialStatus <OperationContract()> <WebInvoke(UriTemplate:="/statuses/update.xml?status={text}")> Sub UpdateStatus(ByVal text As String) End Interface Which code segment should you use to update thesocial status?

A. Using factory As WebChannelFactory(Of ISocialStatus) = For interactive and self-paced preparation ofexam 70-521, try our practice exams.Practice exams also include self assessment and reporting features! New WebChannelFactory(OfISocialStatus)("SocialClient") factory.Credentials.UserName.UserName = user.Name

Page 5: Microsoft CertifyMe 70-521 v2011-10-03 118q By-Errebh

factory.Credentials.UserName.Password = user.Password Dim socialChannel As ISocialStatus =factory.CreateChannel() socialChannel.UpdateStatus(newStatus) End Using

B. Using factory As ChannelFactory(Of ISocialStatus) = New WebChannelFactory(Of ISocialStatus)(GetType(ISocialStatus)) factory.Credentials.UserName.UserName = user.Namefactory.Credentials.UserName.Password = user.Password Dim socialChannel As ISocialStatus =factory.CreateChannel() socialChannel.UpdateStatus(newStatus) End Using

C. Using factory As ChannelFactory(Of ISocialStatus) = New ChannelFactory(Of ISocialStatus)("POST")factory.Credentials.Windows.ClientCredential.UserName = user.Namefactory.Credentials.Windows.ClientCredential.SecurePassword.SetAt( 0, user.Password) DimsocialChannel As ISocialStatus = factory.CreateChannel() socialChannel.UpdateStatus(newStatus) EndUsing

D. Using factory As WebChannelFactory(Of ISocialStatus) = New WebChannelFactory(Of ISocialStatus)(GetType(ISocialClient))factory.Credentials.Windows.ClientCredential.UserName = user.Namefactory.Credentials.Windows.ClientCredential.SecurePassword.SetAt( 0, user.Password) DimsocialChannel As ISocialStatus = factory.CreateChannel() socialChannel.UpdateStatus(newStatus) EndUsing

Correct Answer: ASection: (none)Explanation

Explanation/Reference:

QUESTION 8.A Windows Communication Foundation (WCF) client uses the following service contract. (Line numbers areincluded for reference only.) 01 <ServiceContract()> 02 Public Interface IService 03 04 <OperationContract()>05 Function Operation1() As String 06 <OperationContract()> 07 Function Operation2() As String 08 09 EndInterface You need to ensure that all calls to Operation1 and Operation2 from the client are encrypted andsigned. What should you do?

A. Set the ProtectionLevel property in line 01 to EncryptAndSign.B. Set the ProtectionLevel property in line 04 and line 06 to Sign.C. Add a SecurityCriticalAttribute for each operation.D. Add a SecuritySafeCriticalAttribute for each operation.

Correct Answer: ASection: (none)Explanation

Explanation/Reference:

QUESTION 9.A WCF service code is implemented as follows. (Line numbers are included for reference only.) 01<ServiceContract()> 02 <ServiceBehavior( 03InstanceContextMode:=InstanceContextMode.Single)> 04 Public Class CalculatorService 05 06<OperationContract()> 07 Public Function Calculate(ByVal op1 As Double, 08 ByVal op As String, ByVal op2As Double) As Double ... 24 End Function 25 26 End Class You need to decrease the response time of theservice. What are two possible ways to achieve this goal? (Each correct answer presents a complete solution.Choose two.)

A. Change the service behavior to the following.<ServiceBehavior( InstanceContextMode:=InstanceContextMode.Single,

Page 6: Microsoft CertifyMe 70-521 v2011-10-03 118q By-Errebh

ConcurrencyMode:=ConcurrencyMode.Multiple)>B. Change the service behavior to the following.

<ServiceBehavior(InstanceContextMode:=InstanceContextMode.PerCall)>C. Require the clients use threads, the Parallel Task Library, or other mechanism to issue service calls in

parallel.D. Require the clients to use async operations when calling the service.

Lead your way to certificates!

Correct Answer: ABSection: (none)Explanation

Explanation/Reference:

QUESTION 10.Your Windows Communication Foundation (WCF) client application uses HTTP to communicate with theservice. You need to enable message logging and include all security information such as tokens and nonces inlogged messages. What should you do?

A. In the application configuration file, add the logKnownPii attribute to the message logging diagnosticssource and set the value of the attribute to true. Generate the ContosoService class using the Add ServiceReference wizard. Add a reference to System.ServiceModel.Routing.dll. Add the following code segment.Dim client As ContosoService = New ContosoService() Dim behavior As SoapProcessingBehavior = NewSoapProcessingBehavior()For interactive and self-paced preparation of exam 70-521, try our practice exams.Practice exams also include self assessment and reporting features! behavior.ProcessMessages = Trueclient.Endpoint.Behaviors.Add(behavior)

B. In the application configuration file, add the following XML segment to the system.serviceModelconfiguration section group. <diagnostics> <messageLogging logMessagesAtTransportLevel="true"logEntireMessage="true" /> </diagnostics>

C. In the machine configuration file, add the following XML segment to the system.serviceModel configurationsection. <machineSettings enableLoggingKnownPii="true" /> Generate the ContosoService class using theAdd Service Reference wizard. Add the following code segment. Dim client As ContosoService = NewContosoService() client.Endpoint.Behaviors.Add(New CallbackDebugBehavior(True))

D. In the machine configuration file, add the following XML segment to the system.serviceModel configurationsection. <machineSettings enableLoggingKnownPii="true" /> In the application configuration file, add thelogKnownPii attribute to the message logging diagnostics source and set the value of the attribute to true. Inthe application configuration file, add the following XML segment to the system.serviceModel configurationsection group.<diagnostics> <messageLogging logMessagesAtTransportLevel="true"/> </diagnostics>

Correct Answer: DSection: (none)Explanation

Explanation/Reference:

QUESTION 11

Page 7: Microsoft CertifyMe 70-521 v2011-10-03 118q By-Errebh

.A Windows Communication Foundation (WCF) service has the following contract. <ServiceContract(Namespace:="http://contoso.com")> Public Interface IShipping <OperationContract()> Function DoWork(ByValid As Integer) As String End Interface This is one of several service contracts hosted by your application. Allendpoints use SOAP 1.2 bindings with WSAddressing 1.0. The System.ServiceModel.MessageLogging tracesource in the system.diagnostics configuration section is configured with one listener. You need to make surethat only the messages that are returned from the DoWork operation are logged. Which

Lead your way to certificates!

XML segment should you add to the system.serviceModel/diagnostics/messageLogging/filters configurationelement?

A. <add xmlns:addr="http://www.w3.org/2005/08/addressing"> //addr:Action[text() = 'http://contoso.com/IShipping/DoWorkResponse'] </add>

B. <add xmlns:soap="http://www.w3.org/2003/05/soapenvelope"> For interactive and self-paced preparation ofexam 70-521, try our practice exams.Practice exams also include self assessment and reporting features! 11 www.selftestengine.com//soap:Action[text() = 'http://contoso.com/IShipping/DoWorkResponse'] </add>

C. <add xmlns:addr="http://www.w3.org/2005/08/addressing"> //addr:Action[text() = 'http://contoso.com/IShipping/DoWork'] </add>

D. <add xmlns:soap="http://www.w3.org/2003/05/soapenvelope"> //soap:Action[text() = 'http://contoso.com/IShipping/DoWork'] </add>

Correct Answer: ASection: (none)Explanation

Explanation/Reference:

QUESTION 12.A Windows Communication Foundation (WCF) service is responsible for transmitting XML documents betweensystems. The service has the following requirements: ·It must minimize the transmission size by attaching theXML document as is without using escape characters or base64 encoding. ·It must interoperate with systemsthat use SOAP but are not built on the .NET platform. You need to configure the service to support theserequirements. Which message encoding should you use?

A. Binary message encodingB. MTOM (Message Transmission Optimization Mechanism) message encodingC. Text message encoding with message version set to noneD. Text message encoding with message version set to SOAP 1.2 Lead your way to certificates!

Correct Answer: B

Page 8: Microsoft CertifyMe 70-521 v2011-10-03 118q By-Errebh

Section: (none)Explanation

Explanation/Reference:

QUESTION 13.Four Windows Communication Foundation (WCF) services are hosted in Microsoft Internet InformationServices (IIS). No behavior configuration exists in the web.config file. You need to configure the application sothat every service and endpoint limits the number of concurrent calls to 50 and the number of concurrentsessions to 25. Which XML segment should you add to the system.serviceModel configuration section of theweb.config file?

A. <behaviors> <serviceBehaviors> <behavior name="*"> <serviceThrottling maxConcurrentCalls="50"maxConcurrentSessions="25"/> </behavior> </serviceBehaviors> </behaviors>

B. <behaviors> <serviceBehaviors> <behavior name="default"> <serviceThrottling maxConcurrentCalls="50"maxConcurrentSessions="25"/> </behavior> </serviceBehaviors> </behaviors>

C. <behaviors> <serviceBehaviors> <behavior name=""> <serviceThrottling maxConcurrentCalls="50"maxConcurrentSessions="25"/> </behavior> </serviceBehaviors> Lead your way to certificates!

</behaviors>D. <behaviors> <serviceBehaviors> <behavior name="ALL"> <serviceThrottling maxConcurrentCalls="50"

maxConcurrentSessions="25"/> </behavior> </serviceBehaviors> </behaviors>

Correct Answer: CSection: (none)Explanation

Explanation/Reference:

QUESTION 14.The endpoint of a Windows Communication Foundation (WCF) service uses basicHttpBinding for its binding.Your company's policies have changed to require that messages not be sent in clear text. You must ensure thatall messages are encrypted when traveling across the network. What should you do?

A. Set the ProtectionLevel property on the service contract and update the binding attribute in the endpointelement of the configuration file to wsHttpBinding.

B. Set the ProtectionLevel property on the service contract and update the bindingConfiguration attribute in theendpoint element of the configuration file to webHttpBinding.

C. Set the PrincipalPermissionAttribute on the service contract and update the binding attribute in the endpointelement of the configuration file to wsHttpBinding.

D. Set the PrincipalPermissionAttribute on the service contract and update the bindingConfiguration attribute inthe endpoint element of the configuration file to wsHttpBinding.

Correct Answer: ASection: (none)Explanation

Page 9: Microsoft CertifyMe 70-521 v2011-10-03 118q By-Errebh

Explanation/Reference:

QUESTION 15.

Lead your way to certificates!

You are moving a Windows Communication Foundation (WCF) service into production. You need to be able tomonitor the health of the service. You only want to enable all performance counter instances exposed by theServiceModelService 4.0.0.0 counter group. Which element should you add to the system.serviceModel sectionin the application configuration file?

A. <diagnostics performanceCounters="ServiceOnly" />B. <diagnostics wmiProviderEnabled="true" performanceCounters="Off" />C. <diagnostics performanceCounters="All" />D. <diagnostics wmiProviderEnabled="true" />

Correct Answer: ASection: (none)Explanation

Explanation/Reference:

QUESTION 16.You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. Youwrite the following code fragment. <StackPanel TextBox.PreviewTextInput="StackPanel_PreviewTextInput"><TextBox Name="TxtBoxA"/> <TextBox Name="TxtBoxB"/> <TextBox Name="TxtBoxC"/> </StackPanel> Youcreate an event handler named StackPanel_PreviewTextInput. You also have a collection of strings namedKeywords. You need to ensure that TxtBoxA and TxtBoxB do not contain any of the strings in the Keywordscollections. Which code segment should you use?

A. Private Sub StackPanel_PreviewTextInput(sender As Object, e As TextCompositionEventArgs) DimfeSource As FrameworkElement = TryCast(sender, FrameworkElement) If feSource.Name = "TxtBoxA"OrElse feSource.Name = "TxtBoxB" Then For Each keyword As String In Keywords If e.Text.Contains(keyword) Then e.Handled = False Return End If Next e.Handled = True End If End Sub

B. Private Sub StackPanel_PreviewTextInput(sender As Object, e As TextCompositionEventArgs) DimfeSource As FrameworkElement = TryCast(e.Source, FrameworkElement) If feSource.Name = "TxtBoxA"OrElse feSource.Name = "TxtBoxB" Then For Each keyword As String In Keywords If e.Text.Contains(keyword) Then e.Handled = False Return End If Next e.Handled = True End If End Sub

C. Private Sub StackPanel_PreviewTextInput(sender As Object, e As TextCompositionEventArgs) DimfeSource As FrameworkElement = TryCast(sender, FrameworkElement) If feSource.Name = "TxtBoxA"OrElse feSource.Name = "TxtBoxB" Then For Each keyword As String In Keywords If e.Text.Contains(keyword) Then e.Handled = True Return End IfFor interactive and self-paced preparation of exam 70-521, try our practice exams.Practice exams also include self assessment and reporting features! Next e.Handled = False End If EndSub

D. Private Sub StackPanel_PreviewTextInput(sender As Object, e As TextCompositionEventArgs) DimfeSource As FrameworkElement = TryCast(e.Source, FrameworkElement) If feSource.Name = "TxtBoxA"OrElse feSource.Name = "TxtBoxB" Then Lead your way to certificates!

Page 10: Microsoft CertifyMe 70-521 v2011-10-03 118q By-Errebh

For Each keyword As String In Keywords If e.Text.Contains(keyword) Then e.Handled = True Return End IfNext e.Handled = False End If End Sub

Correct Answer: DSection: (none)Explanation

Explanation/Reference:

QUESTION 17.You use Microsoft .NET Framework to create a Windows Presentation Foundation (WPF) application. Youcreate a window that contains a Button control and a MenuItem control. Both controls are labeled "Add sugar."The Command properties of the Button and MenuItem controls are set to the same RoutedCommand namedAddSugarCommand. You write the following code segment. Private Sub CanAddSugar(sender As Object, e AsCanExecuteRoutedEventArgs) ... End Sub You need to ensure that when the CanAddSugar method setse.CanExecute to false, the MenuItem and Button controls are disabled. What should you do?

A. Create an event handler for the CanExecuteChanged event of the AddSugarCommand command. Call theCanAddSugar method from within the event handler.Lead your way to certificates!

B. Inherit the AddSugarCommand from the RoutedUICommand class instead of the RoutedCommand class.Call the CanAddSugar method from within the constructor of the AddSugarCommand command.For interactive and self-paced preparation of exam 70-521, try our practice exams.Practice exams also include self assessment and reporting features!

C. Add a CommandBinding object to the CommandBinding property of the MenuItem control.Set the CanExecute property of the CommandBinding object to the CanAddSugar method.

D. Add a CommandBinding object to the CommandBindings property of the window. Set the Commandproperty of CommandBinding to the AddSugarCommand command. Set the CanExecute property of theCommandBinding object to the CanAddSugar method.

Correct Answer: DSection: (none)Explanation

Explanation/Reference:

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

Lead your way to certificates!

Page 11: Microsoft CertifyMe 70-521 v2011-10-03 118q By-Errebh

includes a table named dbo.Documents that contains a column with large binary data. You are creating theData Access Layer (DAL). You add the following code segment to query the dbo.Documents table. (Linenumbers are included for reference only.) 01 Public Sub LoadDocuments(cnx As DbConnection) 02 Dim cmdAs var = cnx.CreateCommand() 03 cmd.CommandText = "SELECT * FROM dbo.Documents" 04 ... 05cnx.Open() 06 07 ReadDocument(reader) 08 End Sub You need to ensure that data can be read as a stream.Which code segment should you insert at line 06?

A. Dim reader As var = cmd.ExecuteReader(CommandBehavior.[Default])B. Dim reader As var = cmd.ExecuteReader(CommandBehavior.SchemaOnly)C. Dim reader As var = cmd.ExecuteReader(CommandBehavior.KeyInfo)D. Dim reader As var = cmd.ExecuteReader(CommandBehavior.SequentialAccess)

Correct Answer: DSection: (none)Explanation

Explanation/Reference:

QUESTION 19.You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create a Windows PresentationFoundation (WPF) application. You create a WPF window in the application. You add the following codesegment to the application. Public Class ViewModel Public Property Data() As CollectionView Get End Get SetEnd Set End Property End Class Public Class BusinessObject Public Property Name() As String Get End GetSet End Set End Property End Class The DataContext property of the window is set to an instance of theViewModel class. The Data property of the ViewModel instance is initialized with a collection of BusinessObjectobjects. You add a TextBox control to the window. You need to bind the Text property of the TextBox control tothe Name property of the current item of the CollectionView of the DataContext object. You also need to ensurethat when a binding error occurs, the Text property of the TextBox control is set to N/A . Which bindingexpression should you use?

A. { Binding Path=Data/Name, FallbackValue='N/A' }B. { Binding Path=Data.Name, FallbackValue='N/A' }C. { Binding Path=Data/Name, TargetNullValue='N/A' }D. { Binding Path=Data.Name, TargetNullValue='N/A' }

Correct Answer: ASection: (none)Explanation

Explanation/Reference:

QUESTION 20.You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. Theapplication connects to a Microsoft SQL Server 2008 database. You create classes by using LINQ to SQLbased on the records shown in the exhibit. (Click the Exhibit button.) You need to create a LINQ query toretrieve a list of objects that contains the OrderID and CustomerID properties. You need to retrieve the total

Page 12: Microsoft CertifyMe 70-521 v2011-10-03 118q By-Errebh

price amount of each Order record. What are two possible ways to achieve this goal? (Each correct answerpresents a complete solution. Choose two.)

Lead your way to certificates!

A. From details In dataContext.Order_Details _ Group details By details.OrderID Into g _ Join order IndataContext.Orders On g.Key = order.OrderID _ Select New With { _ .OrderID = order.OrderID, _.CustomerID = order.CustomerID, _ .TotalAmount = g.Sum(Function(od) od.UnitPrice * od.Quantity) _ }

B. dataContext.Order_Details.GroupJoin(dataContext.Orders, Function(d) d.OrderID, Function(o) o.OrderID,Function(dts, ord) New With { _ .OrderID = dts.OrderID, _ .CustomerID = dts.Order.CustomerID, _.TotalAmount = dts.UnitPrice * dts.Quantity _ })

C. From order In dataContext.Orders _ Group order By order.OrderID Into g _ Join details IndataContext.Order_Details On g.Key = details.OrderID _ Select New With { _ .OrderID = details.OrderID, _.CustomerID = details.Order.CustomerID, _ .TotalAmount = details.UnitPrice* details.Quantity _ }

D. dataContext.Orders.GroupJoin(dataContext.Order_Details, Function(o) o.OrderID, Function(d) d.OrderID,Function(ord, dts) New With { _ .OrderID = ord.OrderID, _ .CustomerID = ord.CustomerID, _ .TotalAmount= dts.Sum(Function(od) od.UnitPrice * od.Quantity) _ })

Correct Answer: ADSection: (none)Explanation

Explanation/Reference:

QUESTION 21.You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. Theapplication connects to a Microsoft SQL Server database. You create the classes shown in the following exhibit.You add the following code segment to the application. (Line numbers are included for reference only.) 01Public Sub QueryPlayers(leagues As List(Of League)) 02 03 End Sub You create a LINQ query to retrieve acollection of Player objects. You need to ensure that the collection includes all the players from each team andevery league. Which code segment should you insert at line 02?

Lead your way to certificates!

Page 13: Microsoft CertifyMe 70-521 v2011-10-03 118q By-Errebh

A. Dim query As var = leagues.[Select](Function(l As ) l.Teams.[Select](Function(t As )B. Players))C. Dim query As var = leagues.[Select](Function(l As ) l.Teams.SelectMany(Function(t As )D. Players))E. Dim query As var = leagues.SelectMany(Function(l As ) l.Teams.SelectMany(Function(t As )F. Players))G. Dim query As var = leagues.SelectMany(Function(l As ) l.Teams.[Select](Function(t As )H. Players))

Correct Answer: CSection: (none)Explanation

Explanation/Reference:

QUESTION 22.You use Microsoft .NET Framework 4 to create a Windows Forms application. You add a new class namedCustomer to the application. You select the Customer class to create a new object data source. You add thefollowing components to a Windows Form: ·A BindingSource component named customerBindingSource that isdatabound to the Customer object data source. ·A set of TextBox controls to display and edit the Customerobject properties. Each TextBox control is databound to a property of the customerBindingSource component.·A n ErrorProvider component named errorProvider that validates the input values for each TextBox control.You need to ensure that the input data for each TextBox control is automatically validated by using theErrorProvider component.For interactive and self-paced preparation of exam 70-521, try our practice exams. Practice exams also includeself assessment and reporting features! Which two actions should you perform? (Each correct answer presentspart of the solution. Choose two.)

A. Implement the validation rules inside the Validating event handler of each TextBox control by throwing anexception when the value is invalid.

B. Implement the validation rules inside the TextChanged event handler of each TextBox control by throwingan exception when the value is invalid.

C. Implement the validation rules inside the setter of each property of the Customer class by throwing anexception when the value is invalid.

D. Add the following code segment to the InitializeComponent method of the Windows Form.Me.errorProvider.DataSource = Me.customerBindingSource E. Add the following code segment to theInitializeComponent method of the Windows Form.

Page 14: Microsoft CertifyMe 70-521 v2011-10-03 118q By-Errebh

Lead your way to certificates!

Me.errorProvider.DataSource = Me.customerBindingSource.DataSource Me.errorProvider.DataMember =Me.customerBindingSource.DataMember

Correct Answer: CDSection: (none)Explanation

Explanation/Reference:

QUESTION 23.You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. Youwrite the following code segment. (Line numbers are included for reference only.) 01 Public Class Contact 02Private _contactName As String 03 04 Public Property ContactName() As String 05 Get 06 Return_contactName 07 End Get 08 Set 09 _contactName = value 10 End Set 11 End Property 12 13 End Class Youadd the following code fragment within a WPF window control. <TextBox> <TextBox.Text> <BindingPath="ContactName" UpdateSourceTrigger="PropertyChanged"> <Binding.ValidationRules><DataErrorValidationRule /> </Binding.ValidationRules> </Binding> </TextBox.Text> </TextBox>For interactive and self-paced preparation of exam 70-521, try our practice exams. Practice exams also includeself assessment and reporting features! 25 www.selftestengine.comThe TextBox control is databound to an instance of the Contact class. You need to ensure that the Contactclass contains a business rule to ensure that the ContactName property is not empty or NULL. You also needto ensure that the TextBox control validates the input data. Which two actions should you perform? (Eachcorrect answer presents part of the solution.Choose two).

A. Replace line 01 with the following code segment. Public Class Contact Implements IDataErrorInfoB. Replace line 01 with the following code segment. Public Class Contact Inherits ValidationRuleC. Replace line 01 with the following code segment. Public Class Contact Implements INotifyPropertyChangingD. Add the following code segment at line 03. Public Event PropertyChanging As

PropertyChangingEventHandler Modify line 08 with the following code segment: Set If Me.PropertyChanging<> Nothing Then PropertyChanging(Me, New PropertyChangingEventArgs("ContactName")) End If IfString.IsNullOrEmpty(value) Then Throw New ApplicationException("Contact name is required") End If_contactName = value End Set

E. Add the following code segment at line 12. Public ReadOnly Property [Error]() As String Get Throw NewException(string.Empty) End Get End Property Public Default ReadOnly Property Item(columnName AsString) As String Get If columnName = "ContactName" AndAlso String.IsNullOrEmpty(Me.ContactName)Then Return "Contact name is required" End If Return Nothing End Get End PropertyLead your way to certificates!

Correct Answer: AESection: (none)Explanation

Page 15: Microsoft CertifyMe 70-521 v2011-10-03 118q By-Errebh

Explanation/Reference:

QUESTION 24.You use Microsoft .NET Framework 4 to create a Windows Forms application. You have a dataset as shown inthe following exhibit. You plan to add a DataGridView to display the dataset. You need to ensure that theDataGridView meets the following requirements: ·Shows Order Details for the selected order. ·Shows onlyOrder Details for items that have UnitPrice greater than 20. ·Sorts Products by ProductName Which codesegment should you use?

A. ordersBindingSource.DataSource = productsBindingSource ordersBindingSource.DataMember ="FK_Order_Details_Products" productsBindingSource.Filter = "UnitPrice > 20" productsBindingSource.Sort= "ProductName"

B. productsDataGridView.DataSource = ordersBindingSource productsBindingSource.Filter = "UnitPrice > 20"productsBindingSource.Sort = "ProductName"

C. order_DetailsBindingSource.DataSource = ordersBindingSource order_DetailsBindingSource.DataMember= "FK_Order_Details_Orders" order_DetailsBindingSource.Filter = "UnitPrice > 20"productsBindingSource.Sort = "ProductName"

D. order_DetailsDataGridView.DataSource = ordersBindingSource order_DetailsBindingSource.Filter ="UnitPrice > 20" productsBindingSource.Sort = "ProductName"

Correct Answer: CSection: (none)Explanation

Explanation/Reference:

QUESTION 25.You are analyzing a Windows client application that uses Microsoft Visual Studio 2010 and Microsoft SQLServer 2008. The application updates two database tables from the main user interface (UI) thread. You needto ensure that the following requirements are met: ·The database tables are either updated simultaneously ornot updated at all. ·Users are notified of the success or failure of the updates. ·Users are able to perform other

Page 16: Microsoft CertifyMe 70-521 v2011-10-03 118q By-Errebh

tasks during the update process. What should you do?

Lead your way to certificates!

A. ?Move the database update logic to a BackgroundWorker thread. ·Ensure that the thread is enclosed in aTransactionScope Using block in the BackgroundWorker DoWork method.

B. ?Use TransactionScope in a Using block on the UI thread. ·Batch the database updates by setting theDbDataAdapter.UpdateBatchSize property to 2.

C. ?Use TransactionScope in a Using block on the main thread. ·Create a BackgroundWorker thread withinthe block. ·Move the database updates to the BackgroundWorker DoWork method.

D. ?Use TransactionScope in a Using block on the UI thread. ·Create a DependentTransaction object withinthe block and pass the object to the BackgroundWorker ReportProgress method. ·Use the object in theReportProgress method to create a new TransactionScope block.

Correct Answer: ASection: (none)Explanation

Explanation/Reference:

QUESTION 26.You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. Theapplication connects to a Microsoft SQL Server database. The application has two DataTable objects thatreference the Customers and Orders tables in the database. The application contains the following codesegment. (Line numbers are included for reference only.) 01 Dim customerOrders As New DataSet() 02customerOrders.EnforceConstraints = True 03 Dim ordersFK As New ForeignKeyConstraint("ordersFK", 04customerOrders.Tables("Customers").Columns("CustomerID"), 05 customerOrders.Tables("Orders").Columns("CustomerID")) 06 07 customerOrders.Tables("Orders").Constraints.Add(ordersFK) You need to ensure thatan exception is thrown when you attempt to delete Customer records that have related Order records. Whichcode segment should you insert at line 06?

A. ordersFK.DeleteRule = Rule.SetDefaultFor interactive and self-paced preparation of exam 70-521, try our practice exams.Practice exams also include self assessment and reporting features!

B. ordersFK.DeleteRule = Rule.NoneC. ordersFK.DeleteRule = Rule.SetNullD. ordersFK.DeleteRule = Rule.Cascade

Correct Answer: BSection: (none)Explanation

Explanation/Reference:

QUESTION 27.You use Microsoft .NET Framework 4 to create an application. The application contains a partially trusted clientassembly and a server assembly. You create a custom sandboxed application domain. You need to ensure that

Page 17: Microsoft CertifyMe 70-521 v2011-10-03 118q By-Errebh

the application can be executed in a partialtrust environment. What should you do?

Lead your way to certificates!

A. Apply the following attribute to the server assembly. <Assembly:AllowPartiallyTrustedCallers(PartialTrustVisibilityLevel=VisibleToAllHosts)>

B. Apply the following attribute to the server assembly. <Assembly:AllowPartiallyTrustedCallers(PartialTrustVisibilityLevel=NotVisibleByDefault)>

C. Apply the following attribute to the client assembly. <Assembly:AllowPartiallyTrustedCallers(PartialTrustVisibilityLevel=VisibleToAllHosts)>

D. Apply the following attribute to the client assembly. <Assembly:AllowPartiallyTrustedCallers(PartialTrustVisibilityLevel=NotVisibleByDefault)>

Correct Answer: BSection: (none)Explanation

Explanation/Reference:

QUESTION 28.You use Microsoft .NET Framework 4 to create a Windows Forms client application. You write the followingcode segment. NotInheritable Class FormSettings Inherits ApplicationSettingsBase <UserScopedSetting> _<DefaultSettingValue("225, 200")> _ Public Property FormSize() As Size Get Return DirectCast(Me("FormSize"), Size) End Get Set Me("FormSize") = value End Set End Property End Class The applicationcontains a form of type Form1 that contains a FormSettings object named frmSettings1. You need to maintainthe user's form size preference each time the user executes the application. Which code segment should youuse?For interactive and self-paced preparation of exam 70-521, try our practice exams. Practice exams also includeself assessment and reporting features!

A. Private Sub Form1_Load(sender As Object, e As EventArgs) frmSettings1.Reset() End Sub Private SubForm1_FormClosing(sender As Object, e As FormClosingEventArgs) frmSettings1.FormSize = Me.SizefrmSettings1.Save() End Sub

B. Private Sub Form1_Load(sender As Object, e As EventArgs) frmSettings1.Reset() End Sub Private SubForm1_FormClosing(sender As Object, e As FormClosingEventArgs) frmSettings1.FormSize = Me.SizefrmSettings1.Upgrade() End Sub

C. Private Sub Form1_Load(sender As Object, e As EventArgs) Me.Size = frmSettings1.FormSize End SubPrivate Sub Form1_FormClosing(sender As Object, e As FormClosingEventArgs) frmSettings1.FormSize =Me.Size frmSettings1.Upgrade() End Sub

D. Private Sub Form1_Load(sender As Object, e As EventArgs) Me.Size = frmSettings1.FormSize End SubPrivate Sub Form1_FormClosing(sender As Object, e As FormClosingEventArgs) frmSettings1.FormSize =Me.Size frmSettings1.Save() End Sub

Correct Answer: DSection: (none)Explanation

Explanation/Reference:

Page 18: Microsoft CertifyMe 70-521 v2011-10-03 118q By-Errebh

QUESTION 29.You use Microsoft .NET Framework 4 to create a Windows Forms application. You write the following codesegment. (Line numbers are included for reference only.) 01 NotInheritable

Lead your way to certificates!

Class FormSettings 02 Inherits ApplicationSettingsBase 03 04 Public Property Description() As [String] 05 Get06 Return DirectCast(Me("Description"), [String]) 07 End Get 08 Set 09 Me("Description") = value 10 End Set11 End Property 12 End Class For interactive and self-paced preparation of exam 70-521, try our practiceexams. Practice exams also include self assessment and reporting features! You need to ensure that the firsttime each user opens the application, a text field displays the following message: "Please enter your setting."Which code segment should you insert at line 03?

A. <UserScopedSetting()> <DefaultSettingValue("Please enter your setting.")>B. <UserScopedSetting()> <SettingsDescription("Description: Please enter your setting.")>C. <ApplicationScopedSetting()> <DefaultSettingValue("Please enter your setting.")>D. <ApplicationScopedSetting()> <SettingsDescription("Description: Please enter your setting.")>

Correct Answer: ASection: (none)Explanation

Explanation/Reference:

QUESTION 30You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. Theapplication connects to a Microsoft SQL Server database. The application uses the following object query toload a product from the database. (Line numbers are included for reference only.) 01 Using advWorksContextAs New AdventureWorksEntities() 02 Dim productQuery As ObjectQuery(Of Product) = 03advWorksContext.Product.Where("it.ProductID = 900") 04 05 End Using You need to log the command that thequery 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: BSection: (none)Explanation

Explanation/Reference:

QUESTION 31You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. Theapplication connects to a Microsoft SQL Server database. You write the following code segment that executestwo commands against the database within a transaction. (Line numbers are included for reference only.) 01

Page 19: Microsoft CertifyMe 70-521 v2011-10-03 118q By-Errebh

Using connection As New SqlConnection(cnnStr) 02 connection.Open() 03 Dim sqlTran As SqlTransaction =connection.BeginTransaction() 04 Dim command As SqlCommand = connection.CreateCommand() 05command.Transaction = sqlTran 06 Try 07 command.CommandText = "INSERT INTOProduction.ScrapReason(Name) VALUES('Wrong size')" 08 command.ExecuteNonQuery() 09command.CommandText = "INSERT INTO Production.ScrapReason(Name) VALUES('Wrong color')" 10command.ExecuteNonQuery() 11 12 End Using You need to log error information if the transaction fails tocommit or roll back.Which code segment should you insert at line 11?

A. sqlTran.Commit() Catch ex As Exception sqlTran.Rollback() Trace.WriteLine(ex.Message) End TryB. sqlTran.Commit() Catch ex As Exception Trace.WriteLine(ex.Message) Try sqlTran.Rollback() Catch

exRollback As Exception Trace.WriteLine(exRollback.Message) End TryFor interactive and self-paced preparation of exam 70-521, try our practice exams.Practice exams also include self assessment and reporting features! End Try

C. Catch ex As Exception Trace.WriteLine(ex.Message) Try sqlTran.Rollback() Catch exRollback AsException Trace.WriteLine(exRollback.Message) End Try Finally sqlTran.Commit() End Try

D. Catch ex As Exception sqlTran.Rollback() Trace.WriteLine(ex.Message) Finally Try sqlTran.Commit() CatchexCommit As Exception Trace.WriteLine(exCommit.Message) End Try End Try

Correct Answer: BSection: (none)Explanation

Explanation/Reference:Lead your way to certificates!

QUESTION 32.You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. Youneed to ensure that users can view content in a bookreading format that displays two pages at a time. Whichcontrol should you use?

A. FlowDocumentB. FlowDocumentReaderC. FlowDocumentPageViewerD. FlowDocumentScrollViewer

Correct Answer: BSection: (none)Explanation

Explanation/Reference:

QUESTION 33.You are designing an ntier Windows application by using Microsoft .NET Framework 4, Microsoft Visual Studio2010, and Microsoft SQL Server 2008. The application will replace an existing client/server application. Theexisting application was created by using Microsoft Visual Basic 6.0 and consists of a series of COMcomponents that access a SQL Server database.You plan to move the existing COM components into a Windows Communication Foundation (WCF) tier. You

Page 20: Microsoft CertifyMe 70-521 v2011-10-03 118q By-Errebh

need to ensure that the COM components can be replaced without impacting the existingFor interactive and self-paced preparation of exam 70-521, try our practice exams. Practice exams also includeself assessment and reporting features! user interface (UI) tier. You also need to ensure that the COMcomponents can be replaced separately. What should you do?

A. Create a common assembly on the UI tier of the new application to interface with the COM components.B. Create a common assembly on the WCF tier of the new application to interface with the COM components.C. Use .NET COM Interop on the client tier to interact directly with the COM components until they are

replaced by the managed code.D. Convert the Visual Basic 6.0 source code to managed code by using the Visual Studio converters. Use

these code components on the client/server application until they are replaced individually with the newpermanent managed code functionality.

Correct Answer: BSection: (none)Explanation

Explanation/Reference:

QUESTION 34.You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. You useMicrosoft ADO.NET Entity Data Model (EDM) to model entities. You create an entity named Person with aschema defined by the following XML fragment.

Lead your way to certificates!

<EntityType Name="CPerson"> <Key> <PropertyRef Name="PersonId" /> </Key> <Property Name="PersonId"Type="Int32" Nullable="false" /> <Property Name="CompanyName" Type="String" /> <PropertyName="ContactName" Type="String" /> <Property Name="ContactTitle" Type="String" /> <PropertyName="Address" Type="String" /> </EntityType> You need to ensure that entities within the application are ableto add properties related to the city, region, and country of Person's address. What should you do?

A. ?Create a new complex type named CAddress that contains the properties for city, region, and country.·Change the Type of the Address property in CPerson to "Self.CAddress".

B. ?Create a SubEntity named Address. ·Map the SubEntity to a stored procedure that retrieves city, region,and country.

C. ?Create a new entity named Address. ·Add a person ID property to filter the results to display only the City,Region, and Country properties for a specific Person entity.

D. ?Create a view named Name that returns city, region, and country along with person IDs. ·Add a WHEREclause to filter the results to display only the City, Region and Country properties for a specific Person entity.

Correct Answer: ASection: (none)Explanation

Explanation/Reference:

QUESTION 35

Page 21: Microsoft CertifyMe 70-521 v2011-10-03 118q By-Errebh

.You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. Youneed to ensure that the application meets the following requirements: ·Displays a menu that is specific to thecontrol selected by the user. ·Displays the menu next to the control. Which control should you use?

A. MenuB. PopUpC. ListBoxD. ContextMenu

Correct Answer: DSection: (none)Explanation

Explanation/Reference:

QUESTION 36.You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. Theapplication connects to a Microsoft SQL Server 2008 database. The database includes a table that containsinformation about all the employees. The database table has a field named EmployeeType that identifieswhether an employee is a Contractor or a Permanent employee. You declare the Employee entity base type.You create a new Association entity named Contractor that inherits the Employee base type. You need toensure that all Contractors are bound to the Contractor class. What should you do?

A. Modify the .edmx file to include the following line of code. <NavigationProperty Name="Type" FromRole="EmployeeType" ToRole="Contractor" />

B. Modify the .edmx file to include the following line of code. <Condition ColumnName="EmployeeType"Value="Contractor" />

C. Use the Entity Data Model Designer to set up an association between the Contractor class andEmployeeType.

D. Use the Entity Data Model Designer to set up a referential constraint between the primary key of theContractor class and EmployeeType.

Correct Answer: BSection: (none)Explanation

Explanation/Reference:

QUESTION 37.You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application thatdisplays an image. You need to ensure that users can stretch and scale the image. Which control should youuse?

A. FrameB. SliderC. ViewboxD. ScrollViewer

Correct Answer: CSection: (none)Explanation

Page 22: Microsoft CertifyMe 70-521 v2011-10-03 118q By-Errebh

Explanation/Reference:

QUESTION 38.You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. Theapplicatio contains a window as shown in the following exhibit. For interactive and self-paced preparation ofexam 70-521, try our practice exams. Practice exams also include self assessment and reporting features! 36www.selftestengine.com

Lead your way to certificates!

http://www.gratisexam.com/

You need to define a DockPanel control that fits the window. Which code fragment should you use?

A. <DockPanel> <Button Content="Left"/> <Button Content="Top" DockPanel.Dock="Top"/> <ButtonContent="Bottom" DockPanel.Dock="Bottom"/> <Button Content="Center"/> </DockPanel>

B. <DockPanel> <Button Content="Top" DockPanel.Dock="Top"/> <Button Content="Bottom"DockPanel.Dock="Bottom"/> <Button Content="Left"/> <Button Content="Center"/> </DockPanel>

C. <DockPanel> <Button Content="Left"/> <Button Content="Top" DockPanel.Dock="Top"/> <ButtonContent="Center"/> <Button Content="Bottom" DockPanel.Dock="Bottom"/> </DockPanel>

D. <DockPanel> <Button Content="Top" DockPanel.Dock="Top"/> <Button Content="Left"/> <ButtonContent="Center"/> <Button Content="Bottom" DockPanel.Dock="Bottom"/> </DockPanel>

Correct Answer: BSection: (none)Explanation

Explanation/Reference:

QUESTION 39

Page 23: Microsoft CertifyMe 70-521 v2011-10-03 118q By-Errebh

.You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. Youplan to create a window that has a layout as shown in the following exhibit. You need to define the codefragment to create the window layout. You also need to ensure that the window contains a splitter line. Whichcode fragment should you use?

Lead your way to certificates!

A. <Grid> <Grid.RowDefinitions> <RowDefinition Height="50*" /> <RowDefinition Height="50*" /> </Grid.RowDefinitions> <StackPanel Grid.Row="0"> <Button>Item1</Button> <Button>Item2</Button> </StackPanel> <GridSplitter HorizontalAlignment="Stretch" VerticalAlignment="Center" ShowsPreview="True"Height="2" /> <TextBlock Grid.Row="1">Please, select an item</TextBlock> </Grid>

B. <Grid> <Grid.RowDefinitions> <RowDefinition Height="50*" /> <RowDefinition Height="50*" /> </Grid.RowDefinitions> <StackPanel Grid.Row="0"> <Button>Item1</Button> <Button>Item2</Button> </StackPanel> <GridSplitter HorizontalAlignment="Center" VerticalAlignment="Stretch" ShowsPreview="True"Height="2" /> <TextBlock Grid.Row="1">Please, select an item</TextBlock> </Grid>

C. <Grid> <Grid.RowDefinitions> <RowDefinition Height="50*" /> <RowDefinition Height="Auto" /><RowDefinition Height="50*" />For interactive and self-paced preparation of exam 70-521, try our practice exams.Practice exams also include self assessment and reporting features! </Grid.RowDefinitions> <StackPanelGrid.Row="0"> <Button>Item1</Button> <Button>Item2</Button> </StackPanel> <GridSplitter Grid.Row="1"HorizontalAlignment="Stretch" VerticalAlignment="Center" ShowsPreview="True" Height="2" /> <TextBlockGrid.Row="2">Please, select an item</TextBlock> </Grid>

D. <Grid> <Grid.RowDefinitions> <RowDefinition Height="50*" /> <RowDefinition Height="Auto" /><RowDefinition Height="50*" /> </Grid.RowDefinitions> <StackPanel Grid.Row="0"> <Button>Item1</Button> <Button>Item2</Button> </StackPanel> <GridSplitter Grid.Row="1" HorizontalAlignment="Center"VerticalAlignment="Stretch" ShowsPreview="True" Height="2" /> <TextBlock Grid.Row="2">Please, selectan item</TextBlock> </Grid>

Correct Answer: CSection: (none)Explanation

Explanation/Reference:

QUESTION 40.You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. You

Page 24: Microsoft CertifyMe 70-521 v2011-10-03 118q By-Errebh

want the application to contain a window as shown in the following exhibit. The application contains thefollowing code fragment. (Line numbers are included for reference only.) 01 <Grid ShowGridLines="True"> 02<Grid.ColumnDefinitions> 03 <ColumnDefinition /> 04 <ColumnDefinition /> 05 <ColumnDefinition /> 06

Lead your way to certificates!

</Grid.ColumnDefinitions>For interactive and self-paced preparation of exam 70-521, try our practice exams. Practice exams also includeself assessment and reporting features! 07 <Grid.RowDefinitions> 08 <RowDefinition /> 09 <RowDefinition />10 <RowDefinition /> 11 </Grid.RowDefinitions> 12 13 <TextBlock FontWeight="Bold" Grid.Row="1"Grid.Column="0">Quarter</TextBlock> 14 <TextBlock FontWeight="Bold" Grid.Row="1"Grid.Column="1">Quarter 1</TextBlock> 15 <TextBlock FontWeight="Bold" Grid.Row="1"Grid.Column="2">Quarter 2</TextBlock> 16 <TextBlock FontWeight="Bold" Grid.Row="2"Grid.Column="0">Products</TextBlock> 17 <TextBlock Grid.Row="2" Grid.Column="1">100000</TextBlock>18 <TextBlock Grid.Row="2" Grid.Column="2">150000</TextBlock> 19 </Grid> You need to create theapplication window.Which code fragment should you insert at line 12?

A. <Rectangle Grid.ColumnSpan="3" Fill="#73B2F5"/> <Rectangle Grid.Row="1" Grid.RowSpan="2"Fill="#73B2F5"/> <TextBlock FontSize="20" FontWeight="Bold" Grid.Row="0">2010 Products Shipped</TextBlock>

B. <Rectangle Grid.ColumnSpan="3" Fill="#73B2F5"/> <Rectangle Grid.Row="1" Grid.RowSpan="1"Fill="#73B2F5"/> <TextBlock FontSize="20" FontWeight="Bold" Grid.ColumnSpan="3" Grid.Row="0">2010Products Shipped</TextBlock>

C. <Rectangle Grid.ColumnSpan="3" Fill="#73B2F5"/> <Rectangle Grid.RowSpan="3" Fill="#73B2F5"/><TextBlock FontSize="20" FontWeight="Bold" Grid.ColumnSpan="3" Grid.Row="0">2010 ProductsShipped</TextBlock>

D. <Rectangle Grid.Column="1" Grid.ColumnSpan="2" Fill="#73B2F5"/> <Rectangle Grid.RowSpan="3"Fill="#73B2F5"/> <TextBlock Grid.Column="1" FontSize="20" FontWeight="Bold" Grid.ColumnSpan="3"Grid.Row="0">2010 Products Shipped</TextBlock>

Correct Answer: CSection: (none)Explanation

Explanation/Reference:

QUESTION 41

Page 25: Microsoft CertifyMe 70-521 v2011-10-03 118q By-Errebh

.You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. You use theADO.NET Entity Framework to model your entities. You use Plain Old CLR Objects (POCO) entities along withsnapshotbased change tracking. The code accesses the POCO entities directly. You need to ensure that thestate manager synchronizes when

Lead your way to certificates!

changes are made to the object graph. Which ObjectContext method should you call?

A. RefreshB. SaveChangesC. DetectChangesD. ApplyPropertyChanges

Correct Answer: CSection: (none)Explanation

Explanation/Reference:

QUESTION 42.You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. Youplan to create a window that has a layout as shown in the following exhibit. You need to define the codefragment to create the window layout. Which code fragment should you use?

Lead your way to certificates!

Page 26: Microsoft CertifyMe 70-521 v2011-10-03 118q By-Errebh

A. <StackPanel Orientation="Vertical" Background="Gainsboro"> <TextBlock Text="Name:" /> <TextBoxVerticalAlignment="Top" /> <TextBlock Text="Password:" /> <TextBox VerticalAlignment="Top" /> <ButtonHorizontalAlignment="Center" VerticalAlignment="Center" Width="100" Content="Submit" />For interactive and self-paced preparation of exam 70-521, try our practice exams.Practice exams also include self assessment and reporting features! </StackPanel>

B. <Grid Background="Gainsboro"> <Grid.RowDefinitions> <RowDefinition/> <RowDefinition/><RowDefinition/> </Grid.RowDefinitions> <TextBlock Text="Name:" Grid.Row="0"/> <TextBoxVerticalAlignment="Top" Grid.Row="0" /> <TextBlock Text="Password:" Grid.Row="1"/> <TextBoxVerticalAlignment="Top" Grid.Row="1" /> <Button HorizontalAlignment="Center" VerticalAlignment="Center"Width="100" Content="Submit" Grid.Row="2"/> </Grid>

C. <UniformGrid Rows="3" Columns="1" Background="Gainsboro"> <TextBlock Text="Name:" /> <TextBoxVerticalAlignment="Top" /> <TextBlock Text="Password:" /> <TextBox VerticalAlignment="Top" /> <ButtonHorizontalAlignment="Center" VerticalAlignment="Center" Width="100" Content="Submit" /> </UniformGrid>

D. <UniformGrid Rows="5" Background="Gainsboro"> <TextBlock Text="Name:" /> <TextBoxVerticalAlignment="Top" /> <TextBlock Text="Password:" /> <TextBox VerticalAlignment="Top" /> <ButtonHorizontalAlignment="Center" VerticalAlignment="Center" Width="100" Content="Submit" /> </UniformGrid>

Correct Answer: DSection: (none)Explanation

Explanation/Reference:

QUESTION 43.You are upgrading a standalone Windows Presentation Foundation (WPF) application and an XAML browserapplication (XBAP) to Microsoft .NET Framework 4. You plan to add .NET 4 types and members to bothapplications. Both applications consume a common utility assembly that modifies files on a local file system.The utility assembly requires full trust. You need to ensure that both applications can use the common utilityassembly without any

Lead your way to certificates!

Page 27: Microsoft CertifyMe 70-521 v2011-10-03 118q By-Errebh

securityrelated exceptions. What should you do?

A. Change the <supportedRuntime> element for the WPF application to the .NET Framework 3.5.B. Change the <supportedRuntime> element for the XBAP application to the .NET Framework 3.5.C. Apply the AllowPartiallyTrustedCallersAttribute attribute to the utility assembly.D. Apply the AllowPartiallyTrustedCallersAttribute attribute to the XBAP application.

Correct Answer: CSection: (none)Explanation

Explanation/Reference:

QUESTION 44.You are designing an application by using Microsoft .NET Framework 4 and Microsoft Visual Studio 2010. Theapplication will store data that includes a time and date stamp. The middle tier of the application is implementedby using Windows Communication Foundation (WCF). The middle tier connects to geographically separateddatabase servers. You need to ensure that the application meets the following requirements: ·Data storedcontains time and date information local to the database server. ·Data stored contains Universal CoordinatedTime (UTC). Which class should you use?

A. DateTimeB. DateTimeOffsetC. TimeZoneD. TimeZoneInfo

Correct Answer: BSection: (none)Explanation

Explanation/Reference:

QUESTION 45.

Lead your way to certificates!

You are designing a Windows Presentation Foundation (WPF) application by using Microsoft .NET Framework4 and Microsoft Visual Studio 2010. The application will be deployed on Windows 7 computers in the UnitedStates and Europe. You need to ensure that array data is sorted based on the culture of the operating system.What should you do?

A. Add a configuration setting to the appSettings section of the App.config file.B. Use a comparison method to compare ASCII values.C. Use the Resource Manager to create culturesorted lists.D. Use a comparison method that specifies a CultureInfo class or the CompareOptions enumeration

Page 28: Microsoft CertifyMe 70-521 v2011-10-03 118q By-Errebh

parameter.

Correct Answer: DSection: (none)Explanation

Explanation/Reference:

QUESTION 46.You are designing a new feature for an existing Windows Forms application by using Microsoft .NETFramework 4. The application contains multiple forms that are loaded into a parent Multiple Document Interface(MDI) form. Your company policy does not allow the use of thirdparty controls. You need to ensure that the newfeature meets the following

Lead your way to certificates!

requirements: ·It provides a threedimensional scale model. ·It allows users to change the colors of the modeland communicates the color selections back to the application. ·It allows the model to scale, based on theuser's client computer display resolution. ·It is a child form in the MDI application. What should you do?

A. ?Design the new feature in the existing Windows Forms application as a Windows form. ·Add the form as achild form to the MDI window.

B. ?Design the new feature in a new application by using Windows Presentation Foundation (WPF). ·Invokethe new WPF application from the existing Windows Forms application.

C. ?Design the new feature in a new Windows Presentation Foundation (WPF) application. ·Host the existingapplication inside the new WPF application by using the WindowsFormsHost class.

D. ?Design the new feature by using a Windows Presentation Foundation (WPF) user control. ·Use theElementHost class to host the WPF user control in the existing Windows Forms application.

Correct Answer: DSection: (none)Explanation

Explanation/Reference:

QUESTION 47.You use Microsoft .NET Framework 4 to create a Windows Presentation Framework (WPF) application. Youplan to create a custom control that contains four text input fields. Each of the text input fields within the controlwill contain a label. You need to ensure that the text input fields within the control can be validated by using aregular expression validator. Which class should you inherit from?

A. TextBoxB. TextElementC. UIElementD. UserControl

Correct Answer: D

Page 29: Microsoft CertifyMe 70-521 v2011-10-03 118q By-Errebh

Section: (none)Explanation

Explanation/Reference:

QUESTION 48.You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. Theapplication has multiple data entry windows. Each window contains controls that allow the user to type differentaddresses for shipping and mailing. All addresses have the same format. You need to ensure that you canreuse the controls. What should you create?

A. a user controlB. a data templateC. a control templateD. a control that inherits the Canvas class

Lead your way to certificates!

Correct Answer: ASection: (none)Explanation

Explanation/Reference:

QUESTION 49.You are designing an application by using Windows Presentation Foundation (WPF) and Microsoft .NETFramework 4. You plan to create a wizard by using a Window, a Frame, and several Page objects. The wizardwill use the NavigationService. The NavigationService will be invoked by buttons on the user interface (UI). Youneed to ensure that priorpage navigation can be disabled. What should you do?

A. In the button OnClick event, remove the previous wizard page from the journal.B. In the button OnClick event, remove the previous wizard page from the Window.C. In the button OnMouseDown event, remove the previous wizard page from the Frame.D. In the button OnMouseDown event, remove the previous wizard page from the Window.

Correct Answer: ASection: (none)Explanation

Explanation/Reference:

QUESTION 50.You are designing an application by using Windows Presentation Foundation (WPF) and Microsoft .NETFramework 4. The application retrieves customer data from an enterprise resource planning (ERP) system.You need to ensure that the following requirements are met: ·Customer data is retrieved only once. ·Customerdata is available on multiple forms within the application. ·Forms can implement TwoWay binding to the

Page 30: Microsoft CertifyMe 70-521 v2011-10-03 118q By-Errebh

customer data. What should you do?

A. Store the results of the query in a static DataTable object that is used by all the forms.B. Store the results of the query in a local XML file. Bind all forms to an XMLDataAdapter Lead your way to

certificates!

object that references the local XML file.C. Design a static class for the data that implements the IObservable interface. Subscribe to the static class

from each of the forms that use the data.D. Design a static class for the data that implements the INotifyPropertyChanged interface.

Raise the PropertyChanged event to notify the forms when data is changed.

Correct Answer: DSection: (none)Explanation

Explanation/Reference:

QUESTION 51.You are designing an application by using Windows Presentation Foundation (WPF), Microsoft .NETFramework 4, and Microsoft SQL Server 2008. The application will contain several forms that include customdata validators. You need to ensure that data is validated before the database updates occur. You also need toensure that the validation logic can be reused. How should you design the validation?

A. Implement the IDataErrorInfo interface in the data class of the application.B. Implement the INotifyPropertyChanged interface in the data class of the application.C. ?Subscribe to the MouseLeave event for all user interface (UI) components of the application. ·Perform

data validation in the event handler and alert users when a data entry error occurs.D. ?Subscribe to the TextChanged event for all user interface (UI) components of the application. ·Perform

data validation in the event handler and alert users when a data entry error occurs.

Correct Answer: ASection: (none)Explanation

Explanation/Reference:Lead your way to certificates!

QUESTION 52.You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create a Windows PresentationFoundation (WPF) application. The application contains a ListBox control named lbxItems that is databound toa collection of objects. Each object has a DisplayValue property. You add a Button control to the application.

Page 31: Microsoft CertifyMe 70-521 v2011-10-03 118q By-Errebh

You need to ensure that the Content property of the Button control is databound to the DisplayValue property ofthe selected item of lbxItems.Which binding expression should you use?

A. { Binding ElementName=lbxItems, Source=SelectedItem, Path=DisplayValue }B. { Binding Source=lbxItems, ElementName=SelectedItem, Path=DisplayValue }C. { Binding ElementName=lbxItems, Path=SelectedItem.DisplayValue }D. { Binding Source=lbxItems, Path=SelectedItem.DisplayValue } Lead your way to certificates!

Correct Answer: CSection: (none)Explanation

Explanation/Reference:

QUESTION 53.You are developing a Windows application by using Microsoft .NET Framework 4, Microsoft Visual Studio 2010,and Microsoft SQL Server 2008. The application will store data in a SQL Server database instance. You plan touse the Code Generation technology to develop data entities. You need to ensure that the followingrequirements are met: ·When the application runs, a database must be created if it does not already exist.·When the database schema changes, data entities must be added dynamically. Which data access technologyshould you use?

A. LINQ to SQLB. ADO.NET Data ViewC. ADO.NET Typed DataSetsD. ADO.NET Entity Framework

Correct Answer: DSection: (none)Explanation

Explanation/Reference:

QUESTION 54.You are designing a Windows application by using Microsoft .NET Framework 4, Microsoft Visual Studio 2010,and Microsoft SQL Server 2008. You need to design a data access strategy that meets the followingrequirements: ·Automatically tracks changes ·Maps the database data model to the object model Which dataaccess technology should you use? For interactive and self-paced preparation of exam 70-521, try our practiceexams. Practice exams also include self assessment and reporting features!

A. LINQ to SQLB. LINQ to XMLC. ADO.NET DataSetD. ADO.NET DataReader

Page 32: Microsoft CertifyMe 70-521 v2011-10-03 118q By-Errebh

Correct Answer: ASection: (none)Explanation

Explanation/Reference:

QUESTION 55.You are designing the data access layer (DAL) for an application that uses Microsoft SQL Server 2008,Microsoft ADO.NET, and Microsoft Visual Studio 2010. Conflicts are occurring in the SQL Server database dueto concurrent updates. You need to design a database locking strategy that meets the following requirements:·Resolves concurrent update conflicts without loss of data ·Ensures that data conflicts can be resolved by users·Locks only the data necessary for updates What should you do?

A. Use optimistic locking. Terminate the update when a DBConcurrencyException occurs.B. Use pessimistic locking. Terminate the update when a DBConcurrencyException occurs.C. Use pessimistic locking. Retry the failing update operation in the DBConcurrencyException exception

handler until it succeeds.D. Use optimistic locking. In the DBConcurrencyException exception handler, display the data of both original

and updated records to the user. Allow the user to resolve the conflicts.

Correct Answer: DSection: (none)Explanation

Explanation/Reference:

QUESTION 56.

Lead your way to certificates!

You use Microsoft .NET Framework 4 to create a Windows Forms application. You have a DataGridView that isbound to a DataTable containing a column named ProductName. The ProductName column can contain anyvalid string, except "ProductX," "ProductY," or "ProductZ." You need to ensure that only valid entries forProductName are saved when users edit the DataGridView. Which DataGridView event should you use?

A. CellBeginEditB. InvalidatedC. ValidatedD. Validating

Correct Answer: DSection: (none)Explanation

Explanation/Reference:

Page 33: Microsoft CertifyMe 70-521 v2011-10-03 118q By-Errebh

QUESTION 57You are analyzing an application that uses Microsoft .NET Framework 4 and Microsoft SQL Server 2008. Theapplication is used to maintain an inventory database and is accessed from several remote Windows clientapplications. The application frequently updates multiple rows in a database table by using a DbDataAdapterobject. Users report that the application runs slowly during peak business hours. When large number of recordsare changed by multiple users, you discover the following: ·The CPU utilization of the client applications isnormal. ·The network utilization increases slightly. ·The CPU utilization of the database server remains close tothe normal average for a day. You need to resolve the performance issue. What should you

Lead your way to certificates!

do?

A. Insert a random time interval between updates.B. Move the update method calls to a separate BackgroundWorker thread.C. Disable batch updates. Modify the client application to perform a single update.D. Remove any limit on batch update sizes. Modify the client application to perform a single update.

Correct Answer: DSection: (none)Explanation

Explanation/Reference:

QUESTION 58.You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. Theapplication contains an ObservableCollection object named Pictures that contains several Picture objects. EachPicture object contains the Name and PictureFilePath properties. You add a ListBox control to the application.You need to ensure that the pictures are displayed in the ListBox control. Which code fragment should youuse?

A. <ListBox ItemsSource="{Binding Source={StaticResource pictures}}"> <ListBox.ItemTemplate><DataTemplate> <TextBlock><TextBlock.Text> <Binding Path="PictureFilePath" /> </TextBlock.Text></TextBlock> </DataTemplate> </ListBox.ItemTemplate> </ListBox>

B. <ListBox ItemsSource="{Binding Source={StaticResource pictures}}"> <ListBox.ItemTemplate><DataTemplate> <Image Source="{Binding Source={StaticResource pictures}, Path=PictureFilePath}"/> </DataTemplate> </ListBox.ItemTemplate> </ListBox>

C. <ListBox ItemsSource="{Binding Source={StaticResource pictures}}"> <ListBox.ItemTemplate><DataTemplate> <TextBlock><TextBlock.Text> <Binding Path="Name" /> </TextBlock.Text></TextBlock></DataTemplate> </ListBox.ItemTemplate> For interactive and self-paced preparation of exam 70-521, tryour practice exams.Practice exams also include self assessment and reporting features! 53 Lead your way to certificates!

www.selftestengine.com

Page 34: Microsoft CertifyMe 70-521 v2011-10-03 118q By-Errebh

</ListBox>D. <ListBox ItemsSource="{Binding Source={StaticResource pictures}}"> <ListBox.ItemTemplate>

<DataTemplate> <Image Source="{Binding Path=PictureFilePath}"/> </DataTemplate> </ListBox.ItemTemplate> </ListBox>

Correct Answer: DSection: (none)Explanation

Explanation/Reference:

QUESTION 59.You are deploying an application on Windows client computers by using Microsoft .NET Framework 4 andMicrosoft Visual Studio 2010. You need to ensure that the deployment package meets the followingrequirements: ·Grants only the necessary permissions ·Adds a shortcut to the Windows Start menu ·Registersthe application within Programs and Features ·Can be published to a Web site Which deployment strategyshould you use?

A. XCopyB. ClickOnceC. Merge moduleD. Windows Installer

Correct Answer: BSection: (none)Explanation

Explanation/Reference:

QUESTION 60.You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. Theapplication connects to a Microsoft SQL Server 2008 database. The application uses DataContexts to query thedatabase. You create a function that meets the following requirements: ·Updates the Customer table on thedatabase when a customer is marked as deleted. ·Updates the related entries in other tables(CustomerAddress, CustomerContacts) by marking them as deleted. ·Prevents consumer code from setting theDeleted column's value directly. You need to ensure that the function verifies that customers have nooutstanding orders before they are marked as deleted. You also need to ensure that existing applications canuse the updated function without requiring changes in the code. What should you do?

Lead your way to certificates!

A. Override the Delete operation of the DataContext object.B. Override the Update operation of the DataContext object.C. Modify the SELECT SQL statement provided to the DataContext object to use an INNER JOIN between the

Customer and Orders tables.D. Add new entities to the DataContext object for the Customers and Orders tables.

Page 35: Microsoft CertifyMe 70-521 v2011-10-03 118q By-Errebh

Correct Answer: ASection: (none)Explanation

Explanation/Reference:

QUESTION 61.You are designing a Windows Presentation Foundation (WPF) application by using Microsoft .NET Framework4 and Microsoft SQL Server 2008. The application runs successfully on a local client computer by using youruser account. You deploy the database of the application to the production server. You configure the applicationconnection string to use the Windows Authentication mode. You deploy the application to several clientcomputers that use other applications on the network. The client computers access different databases on theproduction server by using the Windows Authentication mode. Users report that the application is not workingand that they receive a database connection exception. You need to identify the source of the problem. What isthe source of the problem?

A. The database is currently blocked due to locks.B. The users do not have the correct database permissions.C. The users do not have valid SQL Server 2008 database logins.D. The client computers are not configured to use the network.

Correct Answer: BSection: (none)Explanation

Explanation/Reference:

QUESTION 62.You are packaging updates for multiple Windows Presentation Foundation (WPF) applications by usingMicrosoft .NET Framework 4. Updates to the applications and to thirdparty control files are available. Updatesto the applications have dependencies upon updates to the thirdparty control files. An update script is run atlogon that allows only a single command to be executed. You need to package the application updates andupdates to the third party controls to ensure that they are successfully installed. What should you do?

A. Package application updates as a single installer. Package thirdparty control files as a merge module.B. Package application updates as a single installer. Package thirdparty control files as a separate installer.C. Prepare the installers for individual application updates and include the thirdparty control files as individual

files.D. Prepare the installers for individual application updates and include the thirdparty control files as a merge

module.Lead your way to certificates!

Correct Answer: ASection: (none)Explanation

Explanation/Reference:

Page 36: Microsoft CertifyMe 70-521 v2011-10-03 118q By-Errebh

QUESTION 63.You are creating a Windows Presentation Foundation (WPF) application by using Microsoft .NET Framework 4.You need to ensure that when the user attempts to run the application, the user cannot use the application if anew version of the application is available.What should you do?

A. Deploy the application by using the XCopy technology.B. Create a Custom Action within the MSI package to check for updates.C. Use the ClickOnce technology along with the Search for updates during application startup setting.D. Use a BackgroundWorker object on an application load to connect to a Background Intelligent Transfer

Service (BITS) service.

Correct Answer: CSection: (none)Explanation

Explanation/Reference:

QUESTION 64.You have developed a Windows application by using Microsoft .NET Framework 4, Windows PresentationFoundation (WPF), and Microsoft SQL Server 2008. The application is deployed as an XAML BrowserApplication (XBAP) and executes in the Internet Zone in Internet Explorer. The application updates data in aSQL Server 2008 database. Users report that a SecurityException exception occurs when the applicationattempts to save data to the database. You need to design a solution to resolve the problem. What should youdo?

A. Redesign the XBAP application by using partial trust.B. Redesign the XBAP code to utilize stored procedures.C. Design a WCF Service tier to provide database access.

Lead your way to certificates!

D. Design a data access layer that uses ASP.NET Entity Framework to communicate with the database byusing the System.Data.SqlClient class.

Correct Answer: CSection: (none)Explanation

Explanation/Reference:

QUESTION 65.You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create a Windows PresentationFoundation (WPF) application. You plan to implement a test strategy for the application. You need to ensurethat the test strategy meets the following requirements: ·Test data can be added to the test project withoutrecompiling. ·Multiple variations of a test can be executed at run time. What should you do?

Page 37: Microsoft CertifyMe 70-521 v2011-10-03 118q By-Errebh

A. Use IntelliTrace.B. Use datadriven tests.C. Create a single test class.D. Create a test method for each data variation.

Correct Answer: BSection: (none)Explanation

Explanation/Reference:

QUESTION 66.You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create a Windows PresentationFoundation (WPF) application. The application includes a function that is triggered by filling out a form and byclicking a button. Currently, the application is tested manually. You need to create an automated and iterativeprocess to test the application. What should you do?

Lead your way to certificates!

A. Use IntelliTrace.B. Use UISpy.exe to extract the user interface (UI) information. Then, use MSTest.exe.C. Use classes in the System.Windows.Automation and System.Windows.Automation.Text namespaces.D. Use the Action Recording methodology to record the user interface (UI) actions. Then, use MSTest.exe.

Correct Answer: CSection: (none)Explanation

Explanation/Reference:

QUESTION 67.You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create a Windows PresentationFoundation (WPF) application. The application contains a custom control that is used to display customerinformation. You discover that the custom control is not rendering correctly. You need to identify the WPFelement that is causing the issue. What should you do?

A. ?Start the application in release mode. ·Place a breakpoint at the main entry point of the application. ·Usethe debugger to step through the application code.

B. ?Start the application in debug mode. ·Place a breakpoint at the main entry point of the application. ·Use theWPF Tree Visualizer tool.

C. ?Enable IntelliTrace and configure Visual Studio to generate a trace log. ·Start the application in debugmode.

D. ?Enable IntelliTrace and configure Visual Studio to generate a trace log. ·Start the application bydoubleclicking the executable file (.exe).

Page 38: Microsoft CertifyMe 70-521 v2011-10-03 118q By-Errebh

Correct Answer: BSection: (none)Explanation

Explanation/Reference:

QUESTION 68.You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. Theapplication connects to a Microsoft SQL Server database. The application stores encrypted credit cardnumbers in the database. You need to ensure that credit card numbers can be extracted from the database.Which cryptography provider should you use?

A. DSACryptoServiceProviderB. AesCryptoServiceProviderC. MD5CryptoServiceProviderD. SHA1CryptoServiceProvider

Correct Answer: BSection: (none)Explanation

Explanation/Reference:

QUESTION 69.You are developing a Windows Presentation Foundation (WPF) application by using

Lead your way to certificates!

Microsoft .NET Framework 4. You need to recommend a testing strategy to identify the additional hardwareresources that are necessary to support future projected growth. Which testing strategy should yourecommend?

A. Load testingB. Stress testingC. Capacity testingD. Integration testing

Correct Answer: CSection: (none)Explanation

Explanation/Reference:

QUESTION 70.You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application named

Page 39: Microsoft CertifyMe 70-521 v2011-10-03 118q By-Errebh

MyApp.exe. You use Microsoft Windows Installer to package the application. You create an icon file namedApplication.ico. You need to associate Application.ico with MyApp.exe when MyApp.exe is deployed. Whatshould you do?

A. Use the File Types Editor tool.B. Rename the icon file to MyApp.exe.ico.C. Set the AddRemoveProgramsIcon property to Application.ico.D. Use the File System Editor tool to set the Icon property to Application.ico.

Correct Answer: DSection: (none)Explanation

Explanation/Reference:

QUESTION 71You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. Theapplication uses the ADO.NET Entity Framework to model entities. The application allows users to makechanges to entities while disconnected from the central data store. You need to ensure that when the userconnects to the central data store and retrieves new data, the application meets the following requirements:·Changes made to the local data store in disconnected mode are preserved. ·Entities that have already beenloaded into the local data store, but have not been modified by the user, are updated with the latest data. Whatshould you do?

A. Call the query's Execute method by using the MergeOptions.AppendOnly option.B. Call the query's Execute method by using the MergeOptions.OverwriteChanges option.C. Call the Refresh method of ObjectContext by using the RefreshMode.StoreWins option.D. Call the Refresh method of ObjectContext by using the RefreshMode.ClientWins method.

Correct Answer: DSection: (none)Explanation

Explanation/Reference:

QUESTION 72Lead your way to certificates!

You create a Microsoft Windows Installer file for a Windows Presentation Foundation (WPF) application thatrequires Microsoft .NET Framework 4. You need to ensure that the installation starts only if .NET Framework 4is already installed on the computer. What should you do?

A. Use a custom action.B. Set the MinVersion property to .NET Framework 4.C. Set the Version property of Windows Installer to .NET Framework 4.D. Set the Version property of the Launch Condition to .NET Framework 4.

Correct Answer: D

Page 40: Microsoft CertifyMe 70-521 v2011-10-03 118q By-Errebh

Section: (none)Explanation

Explanation/Reference:

QUESTION 73You use Microsoft .NET Framework 4 to create a Windows application. You plan to deploy the application byusing Trusted Application Deployment. The application can only be installed by

Lead your way to certificates!

users who have elevated permissions. You need to ensure that users are not prompted for additionalpermissions when they install the application. Which two actions should you perform? (Each correct answerpresents part of the solution. Choose two.)

A. Obfuscate the assemblies.B. Configure the application as online only.C. Enable User Account Control (UAC) on all client computers.D. Sign the deployment manifest with the publisher's digital certificate.E. Add the publisher of application to the trusted publisher's store on all client computers.

Correct Answer: DESection: (none)Explanation

Explanation/Reference:

QUESTION 74You are designing an application by using Microsoft .NET Framework 4 and Microsoft Visual Studio 2010. Youplan to design an instrumentation strategy for the application. You need to ensure that the strategy meets thefollowing requirements: ·Captures detailed performance information. ·Enables or disables diagnostic messagesby using an application configuration option without requiring the application to restart. What should youdesign?

A. a custom trace listenerB. a custom performance counterC. an override to the Debug classD. an override to the EventLog class

Correct Answer: BSection: (none)Explanation

Explanation/Reference:

QUESTION 75You are creating a Windows Communication Foundation (WCF) service. You do not want to expose the internalimplementation at the service layer. You need to expose the following class as a service named Arithmetic with

Page 41: Microsoft CertifyMe 70-521 v2011-10-03 118q By-Errebh

an operation named Sum. Public Class Calculator Public Function Add(ByVal x As Integer, ByVal y As Integer)As Integer End Function End Class Which code segment should you use?

A. <ServiceContract(Namespace:="Arithmetic")> Public Class Calculator <OperationContract(Action:="Sum")>Public Function Add(ByVal x As Integer, ByVal y As Integer) As Integer ... End Function End Class

B. <ServiceContract(ConfigurationName:="Arithmetic")> Public Class Calculator <OperationContract(Action:="Sum")> Public Function Add(ByVal x As Integer, ByVal y As Integer) As Integer ... End FunctionEnd Class

C. <ServiceContract(Name:="Arithmetic")> Public Class Calculator <OperationContract(Name:="Sum")>Public Function Add(ByVal x As Integer, ByVal y As Integer) As Integer ... End Function End Class

http://www.gratisexam.com/

D. <ServiceContract(Name:="Arithmetic")> Public Class Calculator <OperationContract(ReplyAction:="Sum")>Public Function Add(ByVal x As Integer, ByVal y As Integer) As Integer ... End Function End Class

Correct Answer: CSection: (none)Explanation

Explanation/Reference:

QUESTION 76.You are designing a complex and critical Windows desktop application by using Microsoft .NET Framework 4and Microsoft Visual Studio 2010. You plan to implement a logging strategy for the application. You need torecord all unexpected errors that occur in the

Lead your way to certificates!

application. What should you do?

A. ?Subscribe to the unhandled exception event handler for the AppDomain object. ·Record relevantapplicationspecific information to an external log.

B. ?Subscribe to the unhandled exception event handler for the application's dispatcher on the mainapplication thread. ·Record relevant applicationspecific information to an external log.

C. ?Create a generic catch (Exception e) block in the Main method of the application. ·Record relevantapplicationspecific information to a log in the Main method.

D. ?Create a global WIN 32 unhandled exception filter. ·Record relevant applicationspecific information to anexternal log from within the filter.

Correct Answer: ASection: (none)Explanation

Page 42: Microsoft CertifyMe 70-521 v2011-10-03 118q By-Errebh

Explanation/Reference:

QUESTION 77.You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. Theapplication connects to a Microsoft SQL Server database. The application stores encrypted credit cardnumbers in the database. You need to ensure that credit card numbers can be extracted from the database.Which cryptography provider should you use?

A. DSACryptoServiceProviderB. AesCryptoServiceProviderC. MD5CryptoServiceProviderD. SHA1CryptoServiceProvider

Correct Answer: BSection: (none)Explanation

Explanation/Reference:

QUESTION 78You are designing an application by using Microsoft .NET Framework 4 and Microsoft Visual Studio 2010. Youplan to design an instrumentation strategy for the application. You need to ensure that the strategy meets thefollowing requirements: ·Captures detailed performance information. ·Enables or disables diagnostic messagesby using an application configuration option without requiring the application to restart. What should youdesign?

A. a custom trace listenerB. a custom performance counterC. an override to the Debug classD. an override to the EventLog class

Correct Answer: BSection: (none)Explanation

Explanation/Reference:

QUESTION 79.You are building a client for a Windows Communication Foundation (WCF) service. You need to create a proxyto consume this service. Which class should you use?

A. ChannelFactory(Of TChannel)B. ServiceHostC. ClientRuntimeD. CommunicationObject

Correct Answer: ASection: (none)Explanation

Explanation/Reference:

Page 43: Microsoft CertifyMe 70-521 v2011-10-03 118q By-Errebh

Lead your way to certificates!

QUESTION 80.You are creating a Windows Communication Foundation (WCF) service to process orders. The data contractfor the order is defined as follows. <DataContract()> Public Class Order ... <DataMember()> Public PropertyCardHolderName As String <DataMember()> Public Property CreditCardNumber As String End Class Youhave the following requirements: ·Enable the transmission of the contents of Order from the clients to theservice. For interactive and self-paced preparation of exam 70-521, try our practice exams. Practice examsalso include self assessment and reporting features!·Ensure that the contents of CreditCardNumber are notsent across the network in clear text. ·Ensure that the contents of CreditCardNumber are accessible by theservice to process the order. You need to implement the service to meet these requirements. What should youdo?

A. Add a DataProtectionPermission attribute to the CreditCardNumber property and set the ProtectDataproperty to True.

B. Convert the DataContract to a MessageContract and set the ProtectionLevel property to EncryptAndSign.C. Change the data type of CreditCardNumber from String to SecureString.D. Implement the CreditCardNumber property getter and setter. In the setter, run the value of the

CreditCardNumber through the MD5CryptoServiceProvider class TransformBlock method.

Correct Answer: BSection: (none)Explanation

Explanation/Reference:

http://www.gratisexam.com/