Which code segment should you insert at line 03 to fill the Order table with the next set of 5 records for each increase in the pageIndex value?

You create an application by using the Microsoft .NET Framework 3.5 and Microsoft ADO.NET.

The application contains a DataSet object named orderDS. The object contains a table named Order as shown in the following exhibit.

The application uses a SqlDataAdapter object named daOrder to populate the Order table.
You write the following code segment. (Line numbers are included for reference only.)

01 private void FillOrderTable(int pageIndex) {
02 int pageSize = 5;
03
04 }

You need to fill the Order table with the next set of 5 records for each increase in the pageIndex value.

exhibit Which code segment should you insert at line 03?

You create an application by using the Microsoft .NET Framework 3.5 and Microsoft ADO.NET.

The application contains a DataSet object named orderDS. The object contains a table named Order as shown in the following exhibit.

The application uses a SqlDataAdapter object named daOrder to populate the Order table.
You write the following code segment. (Line numbers are included for reference only.)

01 private void FillOrderTable(int pageIndex) {
02 int pageSize = 5;
03
04 }

You need to fill the Order table with the next set of 5 records for each increase in the pageIndex value.

Which code segment should you insert at line 03?

A.
string sql = “SELECT SalesOrderID, CustomerID, OrderDate FROM Sales.SalesOrderHeader”;
daOrder.SelectCommand.CommandText = sql;
daOrder.Fill(orderDS, pageIndex, pageSize, “Order”);

B.
int startRecord = (pageIndex – 1) * pageSize;
string sql = “SELECT SalesOrderID, CustomerID, OrderDate FROM Sales.SalesOrderHeader”;
daOrder.SelectCommand.CommandText = sql;
daOrder.Fill(orderDS, startRecord, pageSize, “Order”);

C.
string sql = string.Format(“SELECT TOP {0} SalesOrderID, customerID, orderDate FROM Sales.SalesOrderHeader WHERE SalesOrderID > {1}”, pageSize, pageIndex);
daOrder.SelectCommand.CommandText = sql;
daOrder.Fill(orderDS, “Order”);

D.
int startRecord = (pageIndex – 1) * pageSize;
string sql = string.Format(“SELECT TOP {0} SalesOrderID, CustomerID, orderDate FROM Sales.SalesOrderHeader WHERE SalesOrderID > {1}”, pageSize, startRecord);
daOrder.SelectCommand.CommandText = sql;
daOrder.Fill(orderDS, “Order”);



Leave a Reply 7

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


love And Affection Lyrics

love And Affection Lyrics

Hey! This is kind of off topic but I need some advice from an established blog.

Is it difficult to set up your own blog? I’m not very techincal but I can figure things
out pretty fast. I’m thinking about making my own but I’m not sure where to begin.
Do you have any ideas or suggestions? Thank you

construction seattle

construction seattle

I am regular reader, how are you everybody?
This paragraph posted at this web page is really pleasant.

60 day insanity

60 day insanity

What’s up to every body, it’s my first pay a visit of this webpage; this website consists of awesome and actually fine material
in favor of visitors.

nohup

nohup

SqlDataAdapter is a part of the ADO.NET Data Provider and it resides in the System.Data.SqlClient namespace. SqlDataAdapter provides the communication between the Dataset and the SQL database. SqlDataAdapter Object can be used in combination with Dataset Object.

The SqlDataAdapter Object and DataSet objects are combine to perform both data access and data manipulation operations in the SQL Server Database. When the user perform the SQL operations like Select , Insert etc. in the data containing in the Dataset Object , it won’t directly affect the Database, until the user invoke the Update method in the SqlDataAdapter.

nohup

nohup

Parameters
dataSet
Type: System.Data.DataSet
A DataSet to fill with records and, if necessary, schema.
startRecord
Type: System.Int32
The zero-based record number to start with.
maxRecords
Type: System.Int32
The maximum number of records to retrieve.
srcTable
Type: System.String
The name of the source table to use for table mapping.

Google

Google

The time to study or stop by the material or internet sites we’ve linked to beneath.