N
nxliu
I have some code like:
XmlNodeList locationNode = xmlDocument.SelectNodes("xpath string");
PagedDataSource pg = new PagedDataSource();
pg.DataSource = locationNode;
pg.AllowPaging = true;
pg.PageSize = 10;
pg.CurrentPageIndex = 0;
DataList1.DataSource = pg;
DataList1.DataBind();
when I run the program, it throws exception on line DataList1.DataBind():
Exception Details: System.Web.HttpException: Cannot compute Count for a data
source that does not implement ICollection.
Source Error:
Line 114: pg.CurrentPageIndex = 0;
Line 115: DataList1.DataSource = pg;
Line 116: DataList1.DataBind();
Line 117: }
Line 118:
since the XmlNodeList implements IEnumerable, I really can't find where the
problem is.
please help? Thanks in advance!
XmlNodeList locationNode = xmlDocument.SelectNodes("xpath string");
PagedDataSource pg = new PagedDataSource();
pg.DataSource = locationNode;
pg.AllowPaging = true;
pg.PageSize = 10;
pg.CurrentPageIndex = 0;
DataList1.DataSource = pg;
DataList1.DataBind();
when I run the program, it throws exception on line DataList1.DataBind():
Exception Details: System.Web.HttpException: Cannot compute Count for a data
source that does not implement ICollection.
Source Error:
Line 114: pg.CurrentPageIndex = 0;
Line 115: DataList1.DataSource = pg;
Line 116: DataList1.DataBind();
Line 117: }
Line 118:
since the XmlNodeList implements IEnumerable, I really can't find where the
problem is.
please help? Thanks in advance!