Q:
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 dat a. 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.)
01public void LoadDocuments(DbConnection cnx)
02{
03var cmd = cnx.CreateCommand();
04cmd.CommandText = "SELECT * FROM dbo.Documents";
05...
06cnx.Open();
07
08ReadDocument(reader); }
You need to ensure that data can be read as a stream. Which code segment should you insert at line 07?
Answer & Explanation
Answer: D) var reader = cmd.ExecuteReader(CommandBehavior.SequentialAccess);
Explanation:
View Answer
Report Error
Discuss