Is this possible

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I am populating a dataset from a webservice. One one page of my app I need
to get only the first 5 rows from the dataset to pupulate a datagrid and on
another page I then will display all the rows from that dataset in a grid. Is
it possible to select a specific amount of rows from the dataset? Please
don't tell me to use the TOP in a select statement. Remember I am calling a
webservice.

Thanks
 
Yes, remember you ARE calling a webservice, you only get what the webservice
provides: if the webservice only provides a method that returns you whole
DataSet, you can do nothing about it.
 
If you are receiving the entire dataset, you can store it in a sesison
variable, and use it on your second page.

Regards,

Deepak
[I Code, therefore I am]
 
That's not what the question was.

You can just create a separate DataTable that contains the first 5 rows of
the entire datatable in the dataset.
 
Chris:

Once you have the dataset, you can create a DataView on any of the tables.
You may want to add a DataColumn - set its Autoincrement to true and use the
RowFilter to only show those 5 values.

Or you can do a dataTable.Select to get to the same place.
 
Do you really think this is a good way to go? You already have the dataset
and all the data you need is contained therein. Creating another DataTable
will unnecessarily increase resource utilization and provide 0 value - at
least in the sense that you can get to the same place without creating
another table. If he wants to update from that datatable, he'll have to
dance around rowstate if he creates another - again not a big deal but
totally unnecessary.
 
Yes please. A code sample would greatly be appreciated even where I can find
info on this.

Thanks
 
Back
Top