473,386 Members | 1,753 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,386 software developers and data experts.

Lose Gridview paging when changing datasource in ASP.NET (VS 2005)

Dim Conn As New OdbcConnection
Dim PSAdapter As New OdbcDataAdapter
Dim PSCommand As New OdbcCommand
Dim PSDataset As New System.Data.DataSet
Dim szSQL As String
Conn.ConnectionString = GetConnectionStringByName("DM2000_PROD")
PSAdapter = CreatePartSpecAdapter(Conn)
PSCommand.CommandText = szSQL
PSDataView.Table = PSDataTable
PSDataset.Clear()
PSAdapter.Fill(PSDataset, "Table")
GridView1.DataSource = PSDataset
GridView1.DataSourceID = ""
GridView1.DataBind()
The above code works and presents the first page with the paging controls as
the original datasource had, however, when a page selection is made the first
page is
rebuilt. When the original datasource for the gridview is used, paging
works fine.
What am I missing?

Sep 26 '06 #1
0 1099

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

Similar topics

2
by: Kevin Lawrence | last post by:
Hi all Got a GridView, I've enabled paging, I have 12 objects in an array with only 10 to display on each page, when I DataBind() for the first time it says there are 2 pages, however when I...
0
by: wei | last post by:
Hello, all I get a little problem about this gridview paging event, it's work prefect in my local machine, even I used my IP address instead "localhost". when people use this web page, and try to...
0
by: Samuel Shulman | last post by:
It seems that there are some changes to paging in this version (there is no CurrentPageIndex member is it the PageIndex and the e argument of the PageIndexChanged doesn't have any member that...
2
by: Bishop | last post by:
The default gridview paging links are JavaScript and it looks like there is no way for search engines to follow them. Any ideas on what I can do to allow search engines to follow the links so they...
1
by: Matt MacDonald | last post by:
Hi all, I have a gridview on a webform that uses paging. When I have the paging type set to numeric, everything works fine. When I change it to previous and next buttons, I keep getting a data...
0
by: Don Miller | last post by:
Here is an example of what I believe is a bug in ASP.NET 2.0 GridView paging without postbacks (or at least not documented how to fix it). Once the GridView is displayed, clicking on any of the...
1
by: eagle | last post by:
How do I get paging to appear in a gridview even when there is only one page? The gridview I have only shows the page numbers if there is more than one page.
1
by: Matt Winward | last post by:
Hi all. I've got a little problem with my gridview paging and I'm not sure how to resolve it. Basically, I'm handling all aspx requests with my own httphandler. This does a url rewrite, so...
2
by: J | last post by:
I'm trying to highlight a gridview row when it is clicked. Because the gridview is populated via ajax, adding attributes using OnRowCreated doesn't work. How can I best accomplish this? Thanks.
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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,...

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.