What should you do?
You create a mobile Web Form. The mobile Web Form contains a mobile Calendar control named calDate. You need to capture the date that users choose from the Calendar control. What should you do?
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?
Which code segment should you use?
You are developing an application that will use custom authentication and role-based security. You need to write a code segment to make the runtime assign an unauthenticated principal object to each running thread. Which code segment should you use?
Which two code segments should you use?
You create a Web application for your company’s intranet. You want to enable users to customize their versions of the intranet home page. You create sections of content as Web Parts. You need to ensure that users can customize content at any time. Which two code segments should you use? (Each correct answer presents part of the solution. Choose two.)
What should you do?
You create a personalized home page. You want to enable users to choose from a selection of daily headlines from different news providers. You create a series of custom user controls. Each control points to a different news provider. You need to add these controls to the personalized home page. What should you do?
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?
You are creating a Windows Forms application. Initialization code loads a DataSet object named ds that includes a table named Users. The Users table includes a column named IsManager. You need to bind the IsManager column to the Checked property of a check box named chkIsManager. 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?