Which code segment should you use?
You use Microsoft .NET Framework 4 to develop an application that connects to a Microsoft SQL
Server 2008 database. You add the following stored procedure to the database.
CREATE PROCEDURE dtao.InsertTag
BName nvarchar (15)
AS
INSERT INTO Tags (Name) VALUES(@Name)
RETURN @@ROWCOUNT
You need to invoke the stored procedure by using an open SqlConnection named conn. Which code
segment should you use?
Which code segments should you add at lines 07 and 08?
You have the following event receiver. (Line numbers are included for reference only.) 01 public
override void FieldDeleting(SPListEventProperties properties) 02 { 03
base.FieldDeleting(properties); 04 05 if (properties.FieldName == “Status”) 06 { 07 08 09 } 10 }
You need to cancel the operation and redirect the user to a custom error page if the name of the
deleted field is Status. Which code segments should you add at lines 07 and 08?
What should you recommend?
You deploy a medium-trust ASP.NET Web application to a Web server that runs IIS 7.0.
The Web server hosts multiple Web sites. Web applications hosted on the Web server must
not have access to the local resources of other Web applications hosted on the Web server.
You need to recommend a deployment strategy. What should you recommend?
Which address should you choose?
Your network contains a computer named Computer1. Computer1 is assigned an IP address of
192.168.1.112/26. Your company’s corporate policy states that the first usable address in each
subnet is allocated to the default gateway. You need to configure the default gateway for
Computer1. Which address should you choose?
You need to ensure that the entities are self-tracking
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to develop an application.
Vou use the ADO.NET Entity Framework Designer to model entities. You need to ensure that the
entities are self-tracking. What should you do in the ADO.NET Entity Framework Designer?
How should you design the validation?
You are designing an application by using Windows Presentation Foundation (WPF),
Microsoft .NET Framework 4, and Microsoft SQL Server 2008. The application will contain
several forms that include custom data validators. You need to ensure that data is validated
before the database updates occur. You also need to ensure that the validation logic can be
reused. How should you design the validation?
Which approach should you recommend?
You are designing an authentication plan for a SharePoint 2010 intranet site for a large
enterprise. The site administrator and the Active Directory (AD) administrator are concerned
that the traffic on the SharePoint site might cause performance issues related to site
authentication. Average user page sessions typically last longer than 15 minutes. You must
design an authentication plan that provides the best possible performance and meets the
following requirements: ·The plan must be able to accommodate 50,000 users. .The existing
infrastructure must be used as much as possible but the performance problem with user
access must be prevented. Which approach should you recommend?
Which code segment should you use?
You use Microsoft .NET Framework 4 to develop an application that connects to a Microsoft SQL
Server 2008 database. The application includes a table adapter named taStore, which has the
following DataTable.
There is a row in the database that has a ProductID of 680. You need to change the Name column in
the row to “New Product Name”. Which code segment should you use?
Which parent control should you use for Field1?
You create a custom page layout that has a field control named Field1. You need to ensure that
Field1 is only visible when users modify the contents of the page. Which parent control should you
use for Field1?
Which two actions should you perform?
You use Microsoft .NET Framework 4 to develop an application that connects to a Microsoft SQL
Server 2008 database. The database contains a ClassStudent table that contains the StudentID for
students who are enrolled in the classes. You add the following stored procedure to the database.
CREATE PROCEDURE dbo.GetNumEnrolled
@ClassID INT,
@NumEnrolled INT OUTPUT
AS
BEGIN
SET NOCOUNT ON
SELECT GNumEnrolled = COUNT(StudentID)
FROM ClassStudent
WHERE (ClassID = @ClassID)
END
You write the following code. (Line numbers are included for reference only.)
01 Private Function GetNumberEnrolled(
ByVal classID As String) As Integer 02
03 Using conn As New SqlConnection(GetConnectionString())
04
05 Dim cmd As SqlCommand = New SqlCommand(
“GetNumEnro1led”, conn)
06 cmd.CommandType = CommandType.StoredProcedure
07 Dim parClass As SqlParameter – cmd.Parameters.Add(
“8ClassID”, SqlDbType.Int, 4, classID)
08 Dim parNum As SqlParameter = cmd.Parameters.Add(
“@NumEnrolled”, SqlDbType.Int)
09
10 conn.Open()
11
12 End Using
11 End Function
You need to ensure that the GetlMumberEnrolled method returns the number of students who are
enrolled for a specific class. Which two actions should you perform? (Each correct answer presents
part of the solution. Choose two.)