PrepAway - Latest Free Exam Questions & Answers

Author: seenagape

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?

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