You are creating an ASP.NET application for a company where the data is stored in a Microsoft SQL Server 6.5 database. The application needs to generate accounting summary reports from very large transaction tables that contain millions of rows. To return each summary report as quickly as possible, how should you connect to SQL Server and retrieve the data?
Certification
Microsoft Certification
Difficulty: Medium
Choose an option
-
AUse a SqlConnection to connect to SQL Server and a SqlCommand to execute a stored procedure that returns the summary data
-
BUse an OleDbConnection to connect to SQL Server and an OleDbCommand to execute a stored procedure that returns the data
-
CConfigure SQL Server for HTTP access and use an XML template to run a stored procedure that returns XML data
-
DUse COM interop with ADODB.Connection and ADODB.Command to execute a SQL statement that returns the data
Answer
Correct Answer: Use a SqlConnection to connect to SQL Server and a SqlCommand to execute a stored procedure that returns the summary data
Explanation
Introduction / Context:ASP.NET applications commonly access relational data stored in Microsoft SQL Server. When working with very large tables and performance sensitive reporting, it is important to choose the most efficient data access technology and technique. This question asks which combination of connection type and command execution method is best for high performance summary queries in a SQL Server environment.Given Data / Assumptions:
- The back end database is Microsoft SQL Server 6.5.
- The application is built with ASP.NET and Visual Studio .NET.
- Transaction tables contain millions of rows.
- The requirement is to generate summary accounting reports quickly.
- Stored procedures are available or can be created on SQL Server.