data from oledbdatreader can't paged by datagrid

  • Thread starter Thread starter Yangtsi River
  • Start date Start date
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
 
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)
 
Back
Top