Which code segment should you use?
You need to create a method to clear a Queue named q. Which code segment should you use?
Which method should you use on the DirectorySecurity object?
You create a DirectorySecurity object for the working directory. You need to identify the user accounts and groups that have read and write permissions. Which method should you use on the DirectorySecurity object?
Which code segment should you use?
You are creating an undo buffer that stores data modifications. You need to ensure that the undo functionality undoes the most recent data modifications first. You also need to ensure that the undo buffer permits the storage of strings only. Which code segment should you use?
Which three actions should you perform?
You are creating a class that uses unmanaged resources. This class maintains references to managed resources on other objects. You need to ensure that users of this class can explicitly release resources when the class instance ceases to be needed. Which three actions should you perform? (Each correct answer presents part of the solution. Choose three.)
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 are developing a Web application. The Web application uses a GridView control to display data. You build your Web Forms for the Web application by dragging and dropping tables from the Data Connections tree in Server Explorer. You need to add a connection to your data by using the Add Connection dialog box as shown in the exhibit.
During the process, you need to configure the .NET Data Provider that you use to create the data source objects.
What should you do?
What should you do?
You develop a Web application. Your application contains two settings in the Web.config file. You deploy your application to production. You need to modify the application settings in the production environment without manually editing the XML markup in the Web.config file.
What should you do?
What should you do?
You create Web-based client applications. You create a public function for your application that must connect to a data source. The public function must also perform a series of updates to the data. Some of the operations will result in exceptions if there are errors.
Your exception handling mechanism must meet the following requirements:
Callers of the function must be able to ascertain whether the function succeeded or failed. If the function failed, callers of the function must be able to find where and why it failed. If there is any error, the function must immediately stop processing.
You need to identify the best exception handling mechanism. What should you do?
Which code segment should you use?
You create an application to send a message by e-mail. An SMTP server is available on the local subnet. The SMTP server is named smtp.contoso.com. To test the application, you use a source address, me@contoso.com, and a target address, you@contoso.com. You need to transmit the e-mail message. Which code segment should you use?
Which code segment should you use?
You are using the Microsoft Visual Studio 2005 IDE to examine the output of
a method that returns a string. You assign the output of the method to a string variable named fName.
You need to write a code segment that prints the following on a single line
The message: “Test Failed: “
The value of fName if the value of fName does not equal “John”
You also need to ensure that the code segment simultaneously facilitates uninterrupted execution of the application. Which code segment should you use?