A Windows Forms application contains the following code segment.
string SQL = @"SELECT OrderID, ProductID, UnitPrice, Quantity FROM [Order Details]";
SqlDataAdapter da = new SqlDataAdapter(SQL, connStr);
DataTable dt = 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?
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?
You create Microsoft Windows-based applications. You are creating an application that will monitor sales data. The application must meet the following requirements: Users must be able to customize display settings and the amount of data to monitor. Users must be able to log on to any computer on the network to use the application. User settings must be retrieved based on the logged- on user from any computer on the network. You need to decide where to store the user settings. What should you do?
You create Microsoft Windows-based applications. You are creating an application that will monitor sales data. The application must meet the following requirements: Users must be able to customize display settings and the amount of data to monitor. Users must be able to log on to any computer on the network to use the application. User settings must be retrieved based on the logged-on user from any computer on the network. You need to decide where to store the user settings. What should you do?
You are customizing a Windows Form to asynchronously update a database. You need to ensure that the form
displays a message box to the user that indicates the success or failure of the update.
Which three code segments should you use? (Each correct answer presents part of the solution. Choose
three.)
You are customizing a Windows Form to update a database asynchronously by using an instance of a BackgroundWorker component named bgwExecute. You start the component by using the following code.
private void StartBackgroundProcess() {
bgwExecute.DoWork += new DoWorkEventHandler(WorkHandler);
bgwExecute.RunWorkerCompleted += new RunWorkerCompletedEventHandler
(CompletedHandler);
bgwExecute.ProgressChanged += new
ProgressChangedEventHandler(ProgressChanged);
bgwExecute.RunWorkerAsync();
}
If the UpdateDB method that is called by the BackgroundWorker component returns the value False, you need to display a message box to the user that indicates that the update failed. 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?
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?
You are creating a Windows Forms application. You set the FlatAppearance.MouseOverBackColor property of a button to Blue. When testing the application, you notice that the background color does not change when you move the pointer over the button. You need to set the properties of the button so that the background color for the button changes to blue when the pointer moves over the button. What should you do?
You are creating a Windows Form that contains several ToolStrip controls. You need to add functionality that allows a user to drag any ToolStrip control from one edge of the form to another. What should you do?