PrepAway - Latest Free Exam Questions & Answers

What should you do?

You create an application by using the Microsoft .NET Framework 3.5 and Microsoft
ADO.NET. The application connects to a Microsoft SQL Server 2005 database. The
application contains the following objects:
A SqlDataReader object named reader
A SqlCommand object named cmdRecords
A SqlCommand object named cmdUpdate
A SqlConnection object named conn
The SqlConnection object has the following ConnectionString property.”Server=Prod;
Database=Wingtip; Integrated Security=SSPI”
The reader object is obtained from the cmdRecords object. The conn object is shared by the
cmdRecords and the cmdUpdate objects.You need to ensure that for each record in the
reader object, the application calls the ExecuteNonQuery method of the cmdUpdate object.
What should you do?

PrepAway - Latest Free Exam Questions & Answers

A.
Call the InitializeLifeTimeService method of conn.

B.
After you call the reader object, close conn. Before you call the
cmdUpdate.ExecuteNonQuery() method,
reopen conn.

C.
Modify the connection string of conn to contain the following attribute.
AsynchronousProcessing=true;

D.
Modify the connection string of conn to contain the following attribute.
MultipleActiveResultSets=true;


Leave a Reply