473,412 Members | 4,594 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

datagrid error message

I am getting the following error message when I try to load my page

AllowCustomPaging must be true and VirtualItemCount must be set for a
DataGrid with ID DataGrid1 when AllowPaging is set to true and the selected
datasource does not implement ICollection.

Sub Page_Load()
BindDataGrid()
end Sub

Sub BindDataGrid
Dim strConnection As String = "Provider=Microsoft.Jet.OLEDB.4.0;"
strConnection += "Data Source=C:\MyBearHug.mdb;"

Dim strSQL As String = "Select firstname,lastname,businessname from
artists order by lastname;"
Dim objConnection As New
System.Data.OleDb.OleDbConnection(strConnection)
objConnection.Open()

Dim objCommand As New System.Data.OleDb.OleDbCommand(strSQL,
objConnection)
DataGrid1.DataSource = objCommand.ExecuteReader()
DataGrid1.DataBind()
end sub sub

PageIndexChanged(sender as Object, e As DataGridPageChangedEventArgs)
DataGrid1.CurrentPageIndex = e.NewPageIndex
BindDataGrid()
end sub

allowpaging is set to true
onpageindexedchange is set to pageindexchanged
pagerstyle is set to nextprev

Jul 21 '05 #1
2 1194
Hi William,

I did look at your problem (when you send next time to general groups or and
languages groups tell it is webform).

On first sight I did see nothing strange, however there is a problem, there
are two newsgroups where this problem is often in as I have seen.

microsoft.public.dotnet.framework.aspnet
microsoft.public.dotnet.framework.aspnet.datagridc ontrol

You can try it there.

And please send one message to both newsgroups. (crossposting) and not two
messages one by one.

I hope this helps anyhow?

Cor
Jul 21 '05 #2
Hi William,

I did look at your problem (when you send next time to general groups or and
languages groups tell it is webform).

On first sight I did see nothing strange, however there is a problem, there
are two newsgroups where this problem is often in as I have seen.

microsoft.public.dotnet.framework.aspnet
microsoft.public.dotnet.framework.aspnet.datagridc ontrol

You can try it there.

And please send one message to both newsgroups. (crossposting) and not two
messages one by one.

I hope this helps anyhow?

Cor
Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Lina | last post by:
Hi, Can anyone tell me if it is possible to add link buttons to a datagrid that has its source set to a datatable that i have created? i.e i want the user to be able to select a room from...
0
by: Mauro | last post by:
Hi, I need a big help to resolve this problem. I need to put a usercontrol in a datagrid: this control check if the code inserted is present in a archive and if not return a error message. (In...
2
by: Raj | last post by:
Hi, When we are sorting the DataGrid Boolean column the grid is becoming redcross. I have my own PPMIPDataGridBoolColumn class inherited from System.Windows.Forms.DataGridBoolColumn. In this...
2
by: Stephen Miller | last post by:
I am using the OnItemDataBound event of Repeater control to nest a DataGrid within the Repeater. When I attempt to bind to the DataGrid using the DataSource method I get the error message "Object...
8
by: André Almeida Maldonado | last post by:
Hey Guys... What is the diference in bind data into a datagrid without predefined columns and a datagrid with predifined columns???? When I try to bind data into a datagrid without predefined...
3
by: CVerma | last post by:
Hi, I have an embedded datagrid within a datalist. I am not able to perfrom paging in the datagrid. Any ideas? Here is my code: Here is my Simplegrid.cs file: using System; using...
9
by: tshad | last post by:
How do I find (and set) a couple of labels in the Footer after a DataGrid is filled? I have a bunch of DataGrids that get displayed nested inside a DataList. The datagrid looks like: ...
5
by: junglist | last post by:
Hi guys, I've been trying to implement an editable datagrid and i have been succesful up to the point where i can update my datagrid row by row. However what used to happen was that once i updated...
17
by: A_PK | last post by:
I have problem databinding the DataGrid with DataView/DataSet after the filter... I create the following proceudre in order for user to filter as many as they want, but the following code is only...
5
by: Antonio | last post by:
Hello, everyone. Is there a way to not display a certain value in a datagrid cell? I have a datagrid for subscriptions and ebooks and if there isn't an e-book listed, the value from the...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.