What should you conclude?
You create Web-based client applications. You are writing a code segment that queries the following data from a database:
Customer information
Order information
The code segment does not query the database directly. The code segment calls a stored procedure from the database to perform queries. The stored procedure returns information about a customer based on
the customer ID parameter that the code segment provides. The stored procedure accepts the customer ID as an input parameter and includes only one query. The stored procedure returns the result set to the code segment by using output parameters. You need to evaluate whether the stored procedure is designed for best performance and uses the minimum amount of code. What should you conclude?
Which code segment should you use?
You want to execute an event handler asynchronously from a Windows Form. You need to write code that uses the BackgroundWorker component named bgwExecute to execute the WorkHandler method.
Which code segment should you use?
What should you do?
You are an enterprise application developer. You are reviewing the following code segment.
(Line
numbers are included for reference only.)
01 public class MyResource: IDisposable {02 03 private bool disposed = false;04 05 public void Dispose() {06 Dispose(true);07 }08 09 private void Dispose(bool disposing) {10 if(!this.disposed) {11 if(disposing) {12 ReleaseManagedResources();13 }14 ReleaseUnmanagedResources();15 disposed = true;16 }17 }18 19 ~MyResource() {20 ReleaseManagedResources();21 ReleaseUnmanagedResources();22 }23 } You discover that the Dispose pattern is implemented incorrectly. You need to modify the code segment to ensure that the dispose pattern is implemented correctly. What should you do?
Which rationale should you choose?
You create Web-based client applications. You are designing a new Web site for your company. You need to evaluate the design concept for the main page, default.aspx. The default.aspx page contains static information, except for one data grid that displays information about the companys products. The data grid will retrieve the data from a component. The component will retrieve the data from a stored procedure. The page has the appropriate permissions to the Microsoft SQL Server database.
The application design must achieve the following goals without altering the data component:
The default.aspx page must load quickly.
The default.aspx page must contain the latest data from the database.
You decide to use a sqlCacheDependency attribute to ensure that the default.aspx page always displays the latest data in the grid. You need to ascertain whether the use of the sqlCacheDependency attribute meets the requirements of this application. Which rationale should you choose?
Which code segment should you use?
You are customizing a Windows Form to use a BackgroundWorker component named bgwExecute. bgwExecute performs a database operation in an event handler named WorkHandler. You need to ensure that users can see the progress of the database operation by viewing a progress bar named pbProgress. You want the progress bar to appear when the database operation is 50 percent complete.
Which code segment should you use?
What should you do?
You are an enterprise application developer. You develop an application that contains a service component that is exposed as a Web service. You plan to expose the service component by using Remoting and Microsoft Message Queuing (MSMQ). You need to test the service component. You also need to ensure that the tests can be reused, regardless of the technology used for communication. What should you do?
What should you do?
You create Web-based client applications. All Web-based applications are created by using ASP.NET. Larger applications are hosted on Web server farms. The larger applications appear to intermittently lose session state information for users.
You need to correct the problem. What should you do?
Which two code segments should you use?
You want to execute an event handler asynchronously from a Windows Form. You need to execute a method named WorkHandler by using an instance of the BackgroundWorker component named bgwExecute.
Which two code segments should you use? (Each correct answer presents part of the solution. Choose two.)
What should you do?
You are an enterprise application developer. You review the design of a component. The component processes billing for an online store application. The application is developed by using
ASP.NET 2.0. The component must be highly available during business hours. You need to ensure that the component meets the following requirements: It reads all orders that must be billed. It sends an e-mail notification to the users.It receives confirmation for credit card and bank account transactions. What should you do?
Which code segment should you insert?
You create Web-based applications. You are creating an Internet banking application. The application will be used by bank account holders.
You are creating a method to withdraw money from an account. The method must change the account balance according to one of the following rules:
If the amount that is being withdrawn is less than or equal to the account balance, then subtract the amount from the balance.
If the amount that is being withdrawn is greater than the account balance by up to 500 dollars, then subtract the amount and a 35-dollar fee from the balance.
If the amount that is being withdrawn is greater than the account balance by more than 500 dollars, then generate an error.
You are translating the specification given here into pseudo code. You start by writing the following code.
Method
public void Withdraw
Input parameters
decimal amount
Class field
decimal balance
Pseudo code
//your pseudo code
You need to insert the correct pseudo code. Which code segment should you insert?