473,320 Members | 1,958 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,320 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 1189
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
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.