2009-11-17 5 views
0

enter code here hi. 나는 데이터리스트 컨트롤에서 커스텀 페이징을 시도하려고한다. 및이 schive 수 Pagedatasource 사용하고 PagedDataSource objPage = new PagedDataSource();ICollection을 구현하지 않는 데이터 소스의 Count를 계산할 수 없습니다.

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을 구현하지 않는 데이터 소스의 개수를 계산할 수 없습니다. 이런 일을 왜

이 하나가 ToString를 호출하여 당신에게

+1

ds.Dataset.Tables [ "갤러리"] ToString();?. 해야한다. Dataset.Tables [ "Gallery"]; –

답변

1

당신은 문자열에 데이터 원본을 설정하는 감사 나를 도울 수 않습니다().

이 같아야

objPage.DataSource = ds.Dataset.Tables["Gallery"]; 
관련 문제