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?
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?
You create a Web Form. You add the following CreateUserWizard server control to the Web Form. FinishCompleteButtonText="Continue"> Title="New Account"/> Given Name: ID="txtGivenName" /> Last Surname: Title="Complete"/>
You need to write code that redirects users to the first page of the wizard after they click the Continue button on the last page. Which code segment should you use?
You are using the ASP.NET membership APIs to manage user accounts for a Web site. The Web.config file contains the definition for the membership provider. After modifying the Web.config file to enable password recovery, you create a PasswordReset.aspx file. You need to enable users to reset their passwords online. The new passwords must be sent to them by e-mail after they have logged on through the Login.aspx page. In addition, users must be required to answer their secret questions before resetting their passwords. Which code logic should you use?
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?
You create a Web site. The Web site has many predefined roles and associated users that will be used for security purposes. You need to manage these roles and user accounts. Which tool should you use?
You create a Web site with membership and personalization enabled. You must use an existing CRM database for storing the membership information. You need to implement the Membership Provider. What should you do?
You are writing a method to compress an array of bytes. The array is passed to the method in a parameter named document. You need to compress the incoming array of bytes and return the result as an array of bytes. Which code segment should you use?
You create a class library that contains the class hierarchy defined in the following code segment. (Line numbers are included for reference only.)
01 Public Class Group
02 Public Employees As Employee()
03 End Class
05 Public Class Employee
06 Public Name As String
07 End Class
09 Public Class Manager
10 Inherits Employee
11 Public Level As Integer
12 End Class
You create an instance of the Group class. You populate the fields of the instance. When you attempt to serialize the instance by using the Serialize method of the XmlSerializer class, you receive InvalidOperationException. You also receive the following error message: "There was an error generating the XML document." You need to modify the code segment so that you can successfully serialize instances of the Group class by using the XmlSerializer class. You also need to ensure that the XML output contains an element for all public fields in the class hierarchy. What should you do?
You create an application for your business partners to submit purchase orders. The application deserializes XML documents sent by your partners into instances of an object named PurchaseOrder. You need to modify the application so that it collects details if the deserialization process encounters any XML content that fails to map to public members of the PurchaseOrder object. What should you do?