What should you do?

You are creating a Windows Forms application. The application executes a stored procedure that takes several seconds to complete. The stored procedure is invoked to populate a SqlDataReader object. You need to ensure that the application remains responsive to the user while the stored procedure is executing.
What should you do?

You are creating a Windows Forms application. The application executes a stored procedure that takes several seconds to complete. The stored procedure is invoked to populate a SqlDataReader object. You need to ensure that the application remains responsive to the user while the stored procedure is executing.
What should you do?

A.
Use the SqlCommand.BeginExecuteReader method to call the stored procedure.Retrieve results by using the EndExecuteReader method.

B.
Use the SqlCommand.ExecuteReader method.Set the behavior parameter of this method to CommandBehavior.SequentialAccess.

C.
Create and bind a SqlDependency object to a SqlCommand object. Call the SqlCommand.ExecuteReader method.Associate an OnChanged event handler with the SqlDependency object. Gather results in the OnChanged event handler method.

D.
Set the Notification property of a SqlCommand object to a SqlNotificationRequest object. Call the SqlCommand.ExecuteReader method.Gather results on a background thread.



Leave a Reply 0

Your email address will not be published. Required fields are marked *