Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > ADO.NET
|
ADO.NET For discussion about ADO.NET.  Topics such as question regarding the System.Data namespace are appropriate.  Questions specific to a particular application should be posted in a forum specific to the application .
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ADO.NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 23rd, 2003, 07:05 PM
Authorized User
 
Join Date: Jun 2003
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default Paging in ADO.NET

Hi all,

Anyone know how to do paging in ADO.NET other that using DataGrid Web control (which has PageSize property).
The reason I try not to use DataGrid control because I want to get data through Web Service, and want to retrieve data in certain specific range of rows.

Thanks for any input.
Khoa Nguyen
 
Old June 24th, 2003, 01:56 PM
Registered User
 
Join Date: Jun 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to AlanBell
Default

Use the Overloaded DataAdapters Fill method.

Dim Da as New OleDBDataAdapter(SelectStatement, Connection)
Dim Ds as new DataSet()

Da.Fill(ds, 40, 10, "TABLE NAME")

Something like that.

Goodluck

Alan
 
Old June 24th, 2003, 09:40 PM
Authorized User
 
Join Date: Jun 2003
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Alan,

Thanks for replying.
> Da.Fill(ds, 40, 10, "TABLE NAME")
Your example worked very well well. Can you help a little bit more:
I retrieve 3 tables, nested in each other like XML tree:

<Table1>
  <Table2>
    <Table3>
  </Table2>
</Table1>

using follwing compound SQL statements:
"SELECT ID1 FROM Table1; SELECT ID1, ID2 FROM Table2; SELECT ID2 FROM Table3;"

da.Fill(ds);
ds.Tables[0].TableName = "Table1";
ds.Tables[1].TableName = "Table2";
ds.Tables[2].TableName = "Table3";

ds.Relations.Add("R1", ds.Tables[0].Column[ID1], ds.Tables[1].Columns[ID1]).Nested = true;
ds.Relations.Add("R2", ds.Tables[1].Column[ID2], ds.Tables[2].Columns[ID2]).Nested = true;

so can I restrict the range of rows retrieve from Table1, no matter how many rows from nested tables Table2, Table3 ?

Many thanks.
Khoa Nguyen





Similar Threads
Thread Thread Starter Forum Replies Last Post
Difference between ADO and ADO.NET rakeshclose2u ADO.NET 2 April 23rd, 2007 03:57 AM
profesional ASP 3.0 chapter 10 ADO paging josephine_aeiou All Other Wrox Books 2 February 22nd, 2005 02:58 AM
ADO Paging - ASP returns wrong PageCoun spencer Classic ASP Databases 1 July 29th, 2004 06:15 AM
paging asp.net msrnivas .NET Web Services 1 March 1st, 2004 05:12 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.