0
enter code here
嗨。我试图在datalist控件中实现自定义分页。 和我正在使用Pagedatasource来实现这一个页面数据源页面数据源objPage = new PagedDataSource();无法计算未实施ICollection的数据源的计数
try
{
datatable ds= (datatable)viewstate["dtimages"]
objPage.AllowPaging = true;
//Assigning the datasource to the 'objPage' object.
objPage.DataSource = ds.Dataset.Tables["Gallery"].ToString();
//Setting the Pagesize
objPage.PageSize = 8;
dlGallery.DataSource = objPage;
dlGallery.DataKeyField = "Image_ID";
**dlGallery.DataBind();// getting error**
}
catch(Exception ex)
{
throw ex;
}
无法计算未实现ICollection的数据源的计数。
为什么会这样没有任何一个能帮助我 谢谢
ds.Dataset.Tables [ “图库”]的ToString();?。应该是ds.Dataset.Tables [“Gallery”]; – 2009-11-17 13:54:26