when i run my page i get paging Error for Data access and i try to fix it but no way Error is
----------------------------------------------------------------------------------
Error:
AllowCustomPaging must be true and VirtualItemCount must be set for a DataGrid with ID dgTransactions when AllowPaging is set to true and the selected datasource does not implement ICollection.
-------------------------------------------------------------------------------------
the code is
<%@ Page Language="VB" Debug="true" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<script language="VB" Debug="true" runat="server">
dim conn as new oleDBConnection("provider=" & _
"Microsoft.Jet.OLEDB.4.0;" & _
"Data source=f:bankingbanking.mdb")
Sub Page_Load(Source As Object, E As EventArgs)
If Not IsPostBack Then
bindDataGrid
End If
End Sub
Sub bindDataGrid
dim objCmd as OleDbCommand=new OledbCommand("spGetTransactions",conn)
ObjCmd.commandType=CommandType.StoredProcedure
dim objReader as oledbDataReader
dim objParam as oledbParameter
objParam=ObjCmd.parameters.add("@UserID",OleDbType.BSTR)
ObjParam.Direction=ParameterDirection.Input
'objparam.value=request.Cookies("Account").value
objparam.value=session("Uid")
try
objCmd.connection.open
objReader=objCmd.ExecuteReader
dgTransactions.DataSource=ObjReader
dgTransactions.Databind()
objReader.close
objCmd.connection.close
catch ex as OleDbException
lblMessage.text =ex.Message
end try
End Sub
Sub doPaging(s As Object, e As DataGridPageChangedEventArgs)
dgTransactions.CurrentPageIndex = e.NewPageIndex
bindDataGrid
End Sub
AutoGenerateColumns="true"
AllowPaging="true"
PageSize="5"
PagerStyle-Mode="NumericPages"
PagerStyle-HorizontalAlign="Center"
OnPageIndexChanged="doPaging"
BackColor="White"
BorderWidth="1px" BorderStyle="Solid"
Width="100%"
BorderColor="Salmon"
CellPadding="2" CellSpacing="0"
Font-Name="Verdana" Font-Size="8pt">
Font-Bold="True" BackColor="Yellow"
HorizontalAlign="center">