data from oledbdatreader can't paged by datagrid

Y

Yangtsi River

Hi,
I am retrive record from an Access database and want them displayed page by
page,
I used oledbdatareader to retrive and assigned the datasource of datagrid
control to this reader.
but the data can't be paged when using AllowPaging=true, and it displayed
a page using AllowCustomPaging=true,but still can't be paged.

Is that if i want to page the records, I can't use oledbdatareader as
datasource ?
When I tried using oledataset, another problem appeared, the oledbcommand
object don't has a filldataset method.

Is that feasible that I page the records in DataGrid while I use the OLEDB
namespace?

Thanx.
Yangtsi
 
T

Teemu Keiski

Hi,

with custom paging you could do that but you are self responsibel for
returning coorrect data for the DataGrid.

If you use DataSet you would :

1. Create a OleDbCommand object (assumes you already have connection OK)
2. Create OleDbDataAdapter object that takes the command as parameter
(SelectCommand proeprty or constructor)
3. Create DataSet instance that you can fill with OleDbDataAdapter's Fill
method.
4. Bind the DataSet to the grid.

I.e OleDbCommand really doesn't have FillDataSet method but OleDbDataAdapter
is used instead.

--
Teemu Keiski
MCP,Designer/Developer
Mansoft tietotekniikka Oy
http://www.mansoft.fi

ASP.NET Forums Moderator, www.asp.net
AspAlliance Columnist, www.aspalliance.com

Email:
(e-mail address removed)
 

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

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top