Which code segment should you use?
You have an SQL query that takes one minute to execute. You use the following code segment to execute the SQL query asynchronously.
Dim ar As IAsyncResult = cmd.BeginExecuteReader()
You need to execute a method named DoWork() that takes one second to run while the SQL query is executing. DoWork() must run as many times as possible while the SQL query is executing. Which code segment should you use?
What should you do?
You are deploying a Web site to a server managed by a hosting company. The only access you have to the server is through FTP. You need to precompile and deploy the Web site without its source files. What should you do?
Which two actions should you perform?
You are creating a custom user control. The custom user control will be used on 10 Web Forms for an ASP.NET Web site that allows users to register and log on to a personalized experience. The custom user control uses two TextBox controls and two Button controls. You need to ensure that the controls are visible only when users are not logged on to the Web site. You also need to minimize the amount of effort in development and maintenance for the Web site. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)
What should you do?
You create a Web site that you must copy from a development server to a testing server, along with all source files. You do not have terminal access to the testing server. You need to create the virtual directory. Then you must copy the Web site to the virtual directory on the testing server without precompiling the site. What should you do?
Which event should you use?
You create a Web application. The Web application enables users to change fields in their personal profiles. Some of the changes are not persisting in the database. You need to raise a custom event to track each change that is made to a user profile so that you can locate the error.
Which event should you use?
What should you do?
You create a Web site that is for members only. The behavior of the Web site changes according to the role of the user. The Web site uses the ASP.NET Membership control for creation of user accounts. You need to find out whether a user is a member of a particular role. What should you do?
which event handler should you write the code?
You create a Web Form. The Web Form allows users to log on to an application. You include a Login control named Login1 on the Web Form. You need to write code in one of Login1’s event handlers. This code must implement your custom logic that validates the user’s credentials. In which event handler should you write the code?
Which code segment should you use?
You create the following Web user control named ErrorMessages.
<%@ Control Language=”VB” AutoEventWireup=”false”
CodeFile=”ErrorMessages.ascx.vb” Inherits=”ErrorMessages” %> <script>
Protected m_Text As String = “This is a default message!”
Public Property Text() As String
Get
Return m_Text
End Get
Set(ByVal value As String)
m_Text = value
End Set
End Property
</script>
The ErrorMessages control uses a public property that displays the error message. You need to change the default error message property on the Web Form in which the control is implemented. Which code segment should you use?
What should you do?
You are transferring records from one database to another. You need to decide whether you can use the SqlBulkCopy class to transfer the records. What should you do?
What should you do?
A test team plans to conduct performance testing on a Web site that is deployed on a staging server. The test team needs to modify the deployed Web Forms to test different scenarios. You need to deploy the Web site to the staging server without the Web site’s source code files.
What should you do?