这个按钮里面有一条查询语句,点击查询就报这样的错了:当 AllowPaging 设置为真并且选定的数据源不实现 ICollection 时,AllowCustomPaging 必须为真,并且 ID 为 DgshowProject 的 DataGrid 必须设置 VirtualItemCount。 麻烦个位了.按扭里面的代码:Dim str As String = "select * from tab where name='"+Text1.text+"'"        Session("searchP") = str
        Dim mycmd As SqlCommand
        mycmd = con.CreateCommand()
        con.Open()
        //Me.DgshowProject.AllowPaging = False
        mycmd.CommandText = str
        Dim result As SqlDataReader
        result = mycmd.ExecuteReader()
        'DgShowCustomer.DataSource = result
        'DataBind()
        If result.HasRows Then
            DgshowProject.DataSource = result
            DgshowProject.DataBind()
        Else
            Response.Write("<script>alert('數據庫中未找到查詢記錄!');</script>")
            Response.Write("<script>window.location.href='ACM_Project_QO.aspx'</script>")
        End If
       // Me.DgshowProject.AllowPaging = True