PrepAway - Latest Free Exam Questions & Answers

Author: seenagape

Which two procedures should you add to the @productId parameter?

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. You create stored procedures by using the following signatures:

“CREATE procedure [dbo].[Product_Insert](@name varchar(50),@price float)
“CREATE procedure [dbo].[Product_Update](@id int, @name varchar(50), @price float)
“CREATE procedure [dbo].[Product_Delete](@id int)
“CREATE procedure [dbo].[Order_Insert](@productId int, @quantity int)
“CREATE procedure [dbo].[Order_Update](@id int, @quantity int,@originalTimestamp timestamp)
“CREATE procedure [dbo].[Order_Delete](@id int)

You create a Microsoft ADO.NET Entity Data Model (EDM) by using the Product and Order entities as shown in the exhibit. You need to map the Product and Order entities to the stored procedures. Which two procedures should you add to the @productId parameter? (Each correct answer presents part of the solution. Choose two.)

What should you do?

You are designing a Windows Presentation Foundation (WPF) application by using Microsoft .NET Framework 4 and Microsoft Visual Studio 2010. The application will consist of a user interface (UI) tier and a middle tier. The middle tier will be implemented by using Windows Communication Foundation (WCF). You plan to design the exception handling strategy for the application. Each method in the middle tier will contain the following catch block. Catch e As ArgumentNullException

Throw e When testing the application, you discover that all ArgumentNullExceptions that occur in the middle tier do not contain accurate stack trace information. What should you do?

Which code segment should you insert at line 04?

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to develop an application that uses the Entity Framework.
Entity types in the model are generated by the Entity Data Model generator tool (EdmGen.exe).
You write the following code. (Line numbers are included for reference only.)

01 MemoryStream stream = new MemoryStream();
02 var query = context.Contacts.Include(SalesOrderHeaders.SalesOrderDetails);
03 var contact = query.Where(it.LastName = @lastname, new ObjectParameter(lastname, lastName)).First();
04 ….

You need to serialize the contact and all of its related objects to the MemoryStream so that the contact can be deserialized back into the model.
Which code segment should you insert at line 04?

Which code segment should you use?

You create an ASP.NET MVC 2 Web application.
You implement a single project area in the application.
In the Areas folder, you add a subfolder named Test.
You add files named TestController.cs and Details.aspx to the appropriate subfolders.
You register the area’s route, setting the route name to test_default and the area name to test.
You create a view named Info.aspx that is outside the test area.
You need to add a link to Info.aspx that points to Details.aspx.
Which code segment should you use?

Which code segment should you insert at line 03?

You use Microsoft Visual Studio 2010, Microsoft Sync Framework, and Microsoft .NET Framework 4 to create an application. You have a ServerSyncProvider connected to a Microsoft SQL Server database. The database is hosted on a Web server. Users will use the Internet to access the Customer database through the ServerSyncProvider. You write the following code segment. (Line numbers are included for reference only.)

01SyncTable customerSyncTable = new SyncTable(“Customer”);
02customerSyncTable.CreationOption = TableCreationOption. UploadExistingOrCreateNewTable;
03
04customerSyncTable.SyncGroup = customerSyncGroup;
05 this.Configuration.SyncTables.Add(customerSyncTable);

You need to ensure that the application meets the following requirements: “Users can modify data locally and receive changes from the server. “Only changed rows are transferred during synchronization. Which code segment should you insert at line 03?

Which code segment should you insert at line 04?

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?

What are two possible TransactionScope constructors that you can use for the inner transaction to achieve this

You use Microsoft .NET Framework 4.0 to develop an application that connects to a Microsoft SQL Server 2008 database.
The application uses nested transaction scopes. An inner transaction scope contains code that inserts records into the database.
You need to ensure that the inner transaction can successfully commit even if the outer transaction rolls back.

What are two possible TransactionScope constructors that you can use for the inner transaction to achieve this goal?
(Each correct answer presents a complete solution. Choose two.)

Which code segment should you insert at line 04?

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

01using (AdventureWorksEntities advWorksContext = new AdventureWorksEntities())
02{
03ObjectQuery <Product> productQuery = advWorksContext.Product.Where(“it.ProductID = 900”);
04
05}

You need to log the command that the query executes against the data source. Which code segment should you insert at line 04?

Which code segment should you insert at line 03?

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

Class FormSettings 02 Inherits ApplicationSettingsBase 03 04 Public Property Description() As [String] 05 Get 06 Return DirectCast(Me(“Description”), [String]) 07 End Get 08 Set 09 Me(“Description”) = value 10 End Set 11 End Property 12 End Class
You need to ensure that the first time 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?