Which two actions should you perform?

You are developing an application that includes thefollowing code segment. (Line numbers are included
for reference only.)

The GetAnimals() method must meet the following requirements:
-Connect to a Microsoft SQL Server database.
-Create Animal objects and populate them with data from the database.
-Return a sequence of populated Animal objects.
You need to meet the requirements.
Which two actions should you perform? (Each correctanswer presents part of the solution. Choose two.)

You are developing an application that includes thefollowing code segment. (Line numbers are included
for reference only.)

The GetAnimals() method must meet the following requirements:
-Connect to a Microsoft SQL Server database.
-Create Animal objects and populate them with data from the database.
-Return a sequence of populated Animal objects.
You need to meet the requirements.
Which two actions should you perform? (Each correctanswer presents part of the solution. Choose two.)

A.
Insert the following code segment at line 16: while (sqlDataReader.NextResult())

B.
Insert the following code segment at line 13: sqlConnection.Open();

C.
Insert the following code segment at line 13: sqlConnection.BeginTransaction();

D.
Insert the following code segment at line 16: while (sqlDataReader.Read())

E.
Insert the following code segment at line 16: while (sqlDataReader.GetValues())



Leave a Reply 6

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


abhilash

abhilash

B.
Insert the following code segment at line 13: sqlConnection.Open();
D.
Insert the following code segment at line 16: while (sqlDataReader.Read())

vivek

vivek

yes option B and D

mpfariseni

mpfariseni

we opne and read …database

mpfariseni

mpfariseni

we open and read …database

fabrizio

fabrizio

“return customers” must be replaced by “return animals”