Can you convert PagedDataSource to a dataset?

D

darrel

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")).ToString()
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
 
K

Kevin Spencer

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.
 
D

darrel

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top