473,395 Members | 2,467 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Can you convert PagedDataSource to a dataset?

Or, rather, fill a dataset with a PagedDataSource object?

I am using PagedData right now in this manner:
Dim pagedData As New PagedDataSource()

Sub doPaging()

'query the DB and return a copy of the Dataset as pagedData
pagedData.DataSource = getTheData().DefaultView

pagedData.AllowPaging = True
pagedData.PageSize = 10

Try
pagedData.CurrentPageIndex =
System.Int32.Parse(Request.QueryString("Page")).To String()
Catch ex As System.Exception
pagedData.CurrentPageIndex = 0
End Try

Repeater1.DataSource = pagedData
Repeater1.DataBind()

End Sub

That works fine. The catch is that for this particular data, I don't want to
bind it to a rpeater, but rather I'd like to walk through the data manually
and attach it to a string using a stringBuilder.

So, something like:

1 Create new dataset
2 fill dataset with pagedData
3 walk through data an attatch to string builder

The question I have is if you can do step 2 or not.

-Darrel
Nov 19 '05 #1
2 2203
Sounds to me like you would be better off with a DataReader.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"darrel" <no*****@hotmail.com> wrote in message
news:Oo**************@TK2MSFTNGP12.phx.gbl...
Or, rather, fill a dataset with a PagedDataSource object?

I am using PagedData right now in this manner:
Dim pagedData As New PagedDataSource()

Sub doPaging()

'query the DB and return a copy of the Dataset as pagedData
pagedData.DataSource = getTheData().DefaultView

pagedData.AllowPaging = True
pagedData.PageSize = 10

Try
pagedData.CurrentPageIndex =
System.Int32.Parse(Request.QueryString("Page")).To String()
Catch ex As System.Exception
pagedData.CurrentPageIndex = 0
End Try

Repeater1.DataSource = pagedData
Repeater1.DataBind()

End Sub

That works fine. The catch is that for this particular data, I don't want
to
bind it to a rpeater, but rather I'd like to walk through the data
manually
and attach it to a string using a stringBuilder.

So, something like:

1 Create new dataset
2 fill dataset with pagedData
3 walk through data an attatch to string builder

The question I have is if you can do step 2 or not.

-Darrel

Nov 19 '05 #2
> Sounds to me like you would be better off with a DataReader.

I'll look into it.

Right now, I see two options:

1) Send the DS to the PagedData object and then copy that to an array, and
walk through the array.

2) forget the pagedData object altogether and manually do the paging myself
by iterating through the DS manually.

(and, of course, I'll check out the datareader too!)

-Darrel
Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Fresh Air Rider | last post by:
Hi There are plenty of examples on the internet of using the PagedDataSource in conjunction with a dataset to implement paging within the Repeater control. Does anyone know if this is...
2
by: Fresh Air Rider | last post by:
Could anyone please provide a code snippet demonstrating how to use the Repeater control in conjunction with the PagedDataSource class and a Strongly Typed Dataset ? I get an error informing me...
2
by: Fresh Air Rider | last post by:
Hi There are plenty of examples on the internet of using the PagedDataSource in conjunction with a dataset to implement paging within the Repeater control. Does anyone know if this is...
1
by: Fresh Air Rider | last post by:
Hi Fellow Dotnetters Could anyone please provide a code snippet demonstrating how to use the Repeater control in conjunction with the PagedDataSource class and a Strongly Typed Dataset ? I...
0
by: wrytat | last post by:
I declare a PagedDataSource and make its data source be a arraylist that contains objects that I've created myself. Then I bind a Repeater with this PagedDataSource and an error occurs. The...
3
by: Franz | last post by:
Hi, If my ProjectTable contains a lot of rows, each time I call the following code, will all the rows be fetched? Or only those 5 records for that page are fetched only? /* -- code start --...
1
by: Fred Dag | last post by:
I want to get the database table ID of a row in a Repeater that uses a PagedDataSource when OnTexctChanged event is fired. It seems that the DataSource property isn’t persisted when the event is...
1
by: David Lozzi | last post by:
Howdy, Using .Net 2.0 I am using the PagedDataSource to page through my XML data source. My question and / or problem is is this opening the XML data source every time a user clicks through a...
1
by: jazzart | last post by:
Hi there, I'm fairly new to programming with Asp.Net 2.0 so I'm finding myself regularly fumbling around in the dark a bit, so to speak. I'm currently using Visual Web Developer and have been...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.