PrepAway - Latest Free Exam Questions & Answers

Tag: 70-553

Exam 70-553: UPGRADE: MCSD Microsoft .NET Skills to MCPD Enterprise Application Developer by Using the Microsoft .NET Framework: Part 1

Which code segment should you use?

You are developing an application that runs by using the credentials of the end user. Only users who are members of the Administrator group get permission to run the application. You write the following security code to protect sensitive data within the application.

Dim blnAdmin As Boolean = False
Dim objRole As WindowsBuiltInRole = _
WindowsBuiltInRole.Administrator
If blnAdmin = False Then
Throw New Exception(“User not permitted”)
End If

You need to add a code segment to this security code to ensure that the application throws an exception if a user is not a member of the Administrator group. Which code segment should you use?

What should you do?

You are creating a Windows Forms application. The application executes a stored procedure that takes several seconds to complete. The stored procedure is invoked to populate a SqlDataReader object. You need to ensure that the application remains responsive to the user while the stored procedure is executing. What should you do?

Which code segment should you use?

You are creating a Windows Forms application that includes the database helper methods UpdateOrder and UpdateAccount. Each method wraps code that connects to a Microsoft SQL Server 2005 database, executes a Transact-SQL statement, and then disconnects from the database. You must ensure that changes to the database that result from the UpdateAccount method are committed only if the UpdateOrder method succeeds. You need to execute the UpdateAccount method and the UpdateOrder method. Which code segment should you use?

Which code segment should you use?

A Windows Forms application contains the following code segment.
Dim SQL As String = “SELECT OrderID, ProductID, UnitPrice, Quantity FROM [Order Details]” Dim da As New SqlDataAdapter(SQL, connStr)
Dim dt As New DataTable()
da.Fill(dt)

You need to add a new column to the data table named ItemSubtotal. The ItemSubtotal column must contain the value of the UnitPrice column multiplied by the value of the Quantity column. Which code segment should you use?

Which code segment should you use?

You are creating a Windows Forms application. The application uses a SqlCommand object named cmd. The cmd object executes the following stored procedure.

CREATE PROCEDURE GetPhoneList
AS
BEGIN
SELECT CompanyName, Phone FROM Customers
SELECT CompanyName, Phone FROM Suppliers
END

You need to add all returned rows to the ListBox control named lstPhones. Which code segment should you use?


Page 2 of 1012345...10...Last »