Which code segment should you insert at line 06?

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. The application connects to a Microsoft SQL Server 2008 database. The database includes a table named dbo.Documents that contains a column with large binary data. You are creating the Data Access Layer (DAL). You add the following code segment to query the dbo.Documents table. (Line numbers are included for reference only.)

01 Public Sub LoadDocuments(cnx As DbConnection)
02 Dim cmd As var = cnx.CreateCommand()
03 cmd.CommandText = “SELECT * FROM dbo.Documents”
04 …
05 cnx.Open()
06
07 ReadDocument(reader)
08 End Sub

You need to ensure that data can be read as a stream.
Which code segment should you insert at line 06?

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. The application connects to a Microsoft SQL Server 2008 database. The database includes a table named dbo.Documents that contains a column with large binary data. You are creating the Data Access Layer (DAL). You add the following code segment to query the dbo.Documents table. (Line numbers are included for reference only.)

01 Public Sub LoadDocuments(cnx As DbConnection)
02 Dim cmd As var = cnx.CreateCommand()
03 cmd.CommandText = “SELECT * FROM dbo.Documents”
04 …
05 cnx.Open()
06
07 ReadDocument(reader)
08 End Sub

You need to ensure that data can be read as a stream.
Which code segment should you insert at line 06?

A.
Dim reader As var = cmd.ExecuteReader(CommandBehavior.[Default])

B.
Dim reader As var = cmd.ExecuteReader(CommandBehavior.SchemaOnly)

C.
Dim reader As var = cmd.ExecuteReader(CommandBehavior.KeyInfo)

D.
Dim reader As var = cmd.ExecuteReader(CommandBehavior.SequentialAccess)



Leave a Reply 0

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