You need to retrieve the identity of the new record
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. You
create a stored procedure to insert a new record in the Categories table according to following code
segment.
CREATE PROCEDURE dbo.InsertCategory
@CategoryName nvarchar(15),
@Identity int OUT
AS
INSERT INTO Categories (CategoryName) VALUES(@CategoryName)
SET @Identity = SCOPE_IDENTITY()
RETURN @@ROWCOUNT
You write the following code segment. (Line numbers are included for reference only).
1 Private Shared Sub ReturnIdentity(connectionString As String)
2 Using connection As New SqlConnection(connectionString)
3 Dim adapter As New SqlDataAdapter(“SELECT CategoryID, CategoryName FROM
dbo.Categories”, connection)
4 adapter.InsertCommand = New SqlCommand(“InsertCategory”, connection)
5 adapter.InsertCommand.CommandType = CommandType.StoredProcedure
6 Dim rowcountParameter As SqlParameter =
adapter.InsertCommand.Parameters.Add(“@RowCount”, SqlDbType.Int)
7
8 adapter.InsertCommand.Parameters.Add(“@CategoryName”, SqlDbType.NChar, 15,
“CategoryName”)
9 Dim identityParameter As SqlParameter =
10 adapter.InsertCommand.Parameters.Add(“@Identity”, SqlDbType.Int, 0, “CategoryID”)
11
12 Dim categories As New DataTable()
13 adapter.Fill(categories)
14 Dim categoryRow As DataRow = categories.NewRow()
15 categoryRow(“CategoryName”) = “New Beverages”
16 categories.Rows.Add(categoryRow)
17 adapter.Update(categories)
18 Dim rowCount As Int32 =
19 DirectCast(adapter.InsertCommand.Parameters(“@RowCount”).Value, Int32)
20 End Using
21 End Sub
You need to retrieve the identity of the new record. You also need to retrieve the row count. What
should you do?
What should you recommend?
You are designing a .NET Framework 4 solution that contains a Windows Presentation
Foundation (WPF) application. The WPF application includes CPU-intensive calculations.
The calculations can be run on a separate process and can effectively be isolated from the
rest of the WPF application. You need to recommend a deployment strategy that maximizes
the scalability of the calculations for each user. What should you recommend?
You need to ensure that the name of the Web Part displays as Corporate in SharePoint
You create a Web Part named WP1. You need to ensure that the name of the Web Part displays
as Corporate in SharePoint. What should you do?
You need to ensure that the delegate control meets the following requirements…?
You add a delegate control to the <head> section of a custom master page. You reference a
default script file by using the delegate control. You need to ensure that the delegate control
meets the following requirements: Prevents other developers from deleting the default script
reference Provides developers with the ability to add additional script references Provides
developers with the ability to change the order of the script references Which property should you
use?
You need to ensure that the function verifies that customers have no outstanding orders before they are marked
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. The
application connects to a Microsoft SQL Server 2008 database. The application uses DataContexts to
query the database. You create a function that meets the following requirements:
• Updates the Customer table on the database 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 the Deleted columns value directly
You need to ensure that the function verifies that customers have no outstanding orders before they
are marked as deleted. You also need to ensure that existing applications can use the updated
function without requiring changes in the code. What should you do?
Which two actions should you recommend?
You are designing a .NET Framework 4 solution that includes a Windows Presentation
Foundation (WPF) application, a Windows service, and a private assembly shared by the
WPF application and by the Windows service. The solution stores data in a local Microsoft
SQL Server Compact 3.5 database. The WPF application and Windows service will each
access the database directly. The solution will be installed by using Windows Installer. You
have the following requirements: • The installer must allow users to specify the installation
folders for the WPF application and for the database. • The solution must support the
deployment of updates to the WPF application without restarting the Windows service. You
need to recommend an approach for installing the solution. Which two actions should you
recommend? (Each correct answer presents part of the solution. Choose two.)
Which two actions should you recommend?
You are modifying an existing ASP.NET Web application. Each page of the Web application
includes a navigation bar and a print button. You have the following requirements: Enable
users to print pages of the Web site without printing the navigation bar. Do not create a
separate version of the page formatted for printing. Leverage the existing print button on
each page. You need to recommend an approach that meets the requirements. Which two
actions should you recommend? (Each correct answer presents part of the solution. Choose
two.)
Which IsolationLevel should you use?
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to develop an application
that connects to a Microsoft SQL Server 2008 database. The application performs a database query
within a transaction. You need to ensure that the application can read data that has not yet been
committed by other transactions. Which IsolationLevel should you use?
Which approach should you recommend?
You are designing a SharePoint 2010 intranet site for a corporation. Your design must meet
the following requirements: ·The homepage must contain a single Web Part that displays a
view of a specific document library. .Each employee must be able to create a persistent
view of the list that would be filtered, grouped, and sorted based on their selection criteria.
Which approach should you recommend?
You need to ensure that all client computers that access the network are evaluated by NAP
Your company has deployed Network Access Protection (NAP). You configure secure wireless access
to the network by using 802.1X authentication from any access point. You need to ensure that all
client computers that access the network are evaluated by NAP. What should you do?