enter code herehi. i am trying to implment custom paging in datalist control .
and i am using Pagedatasource to schive this one
PagedDataSource objPage = new PagedDataSource();
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;
}
Cannot compute Count for a data source that does not implement ICollection.
why is this happening does any one can help me out
thank you
You’re setting your Data Source to a string by calling ToString().
It should be: