What does this code do?
You are creating a Windows Forms application. You create a System.Threading.Semaphore
instance in the application by using the follwing code.
Semaphore threadPool = new Semaphore(0, 3);
// …ThreadPool.Release(4);
What does this code do?
Which two code segment should you use?
You are creating a Windows Forms application. You want to execute a method named ProcessAmount in the background of the application. The method you want to execute requires that an integer value of 13 is passed. You need to pass an integer value of 13 to a starting background thread. Which two code segment should you use? (Each correct answer presents part of the solution. Choose two.)
Which two code segment 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 segment should you use? (Each correct answer presents part of the solution. Choose two.)
Which segment should you use?
You are customizing a Windows Form to asynchronously update a database in a method named WorkHandler. You need to ensure that the form displays a message box to the user that indicates the success of failure of the update. Which segment should you use?
Which code segment should you use?
You are customizing a Windows Form to use a BackgroundWorker component named bgwExecute. bgwExecute perform a database operation by 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?
Which two actions should you perform?
You are creating a Windows Forms application. You create a class named ApplicationUtilities
and add a method named BackgroundProcess. You anticipate that the BackgroundProcess
method may require several minutes or longer to execute. You need to ensure that the application remains responsive while the BackgroundProcess method runs. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)
What should you do to use the SqlBulkCopy class to import the data?
You have received instructions to import data from a flat file into a into a Microsoft SQL Server 2005 database table.
What should you do to use the SqlBulkCopy class to import the data?
What should you do to use the SqlBulkCopy class to import the data?
You have received instructions to import data from a flat file into a into a Microsoft SQL Server 2005 database table. What should you do to use the SqlBulkCopy class to import the data?
Which code segment should you use?
A Windows Forms application contains the following code segment.
string SQL = @"SELECT EmployeeID, LastName, FirstName, FROM Emloyees";
SqlDataAdapter da = new SqlDataAdapter(SQL, connStr); DataTable dt = new DataTable();
da.MissingSchemaAction = MissingSchemaAction.AddWithKey; SqlCommandBuilder bld = new SqlCommandBuilder(da);
da.Fill(dt);
The application allows the user to add rows to the data table. The application will propagate these additions to the database.
If the addition of any row fails, the other rows must still be added. The code must log how many new rows to be added.
You need to propagate the additions to the database and log a failed count. Which code segment should you use?
Which code segment chould you use?
You are creating a Windows Forms application. The application uses a SqlCommand object named cmd. The cmd object executes the following stored procedure.
CREATE PROCEDURE GetPhoneList
AS
BEGIN
SELECT CompnayName, Phone FROM Customers
SELECT CompanyName, Phone FROM Suppliers
END
You need to add all returned rows to the ListBox control named lstPhones. Which code segment chould you use?