我有过类似的经历。建议使用datareader。数据量多的话建议只取出要显示页一页的数据进行绑定。不然的话会死人的。 Dim start As Integer = CurrentPageIndex * PageSize Dim size As Integer = Math.Min(PageSize, ItemCount - start) Dim CurrentPageDataSource As IList = New ArrayListFor i As Integer = 0 To size - 1 CurrentPageDataSource.Add(OriginalDataSource(start + i)) Next ilist.DataSource = CurrentPageDataSource
因为用dataset的话它是把所有记录读入,然后传给datagrid
datareader每次只读一条,然后传给datagrid
你的记录较多所以用datareader
好象不行吧..
你采取分页方式应该没有问题哦
Dim start As Integer = CurrentPageIndex * PageSize
Dim size As Integer = Math.Min(PageSize, ItemCount - start)
Dim CurrentPageDataSource As IList = New ArrayListFor i As Integer = 0 To size - 1
CurrentPageDataSource.Add(OriginalDataSource(start + i))
Next ilist.DataSource = CurrentPageDataSource