473,666 Members | 2,713 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Dat aSet
Dim szSQL As String
Conn.Connection String = GetConnectionSt ringByName("DM2 000_PROD")
PSAdapter = CreatePartSpecA dapter(Conn)
PSCommand.Comma ndText = szSQL
PSDataView.Tabl e = PSDataTable
PSDataset.Clear ()
PSAdapter.Fill( PSDataset, "Table")
GridView1.DataS ource = PSDataset
GridView1.DataS ourceID = ""
GridView1.DataB ind()
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 1106

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

Similar topics

2
1178
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 click to go the 2nd page it just displays the 1st page, unless I click it again, here is my event handler code - I'm sure there's something missing: protected void grdSubmittedCCDEV_PageIndexChanging(object sender, GridViewPageEventArgs e)
0
910
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 click the page number(1,2,...) from them machine nothing happens. I checked all browser sitting, javascript is enabled, it's seems something to do with doPostlBack any ideas thanks
0
2194
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 indicates the Index value) Any links, explanations? Thank you, Samuel
2
2190
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 can index all the data in the datagrid with paging.
1
1084
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 error that it's trying to use a connection that was left open. I'm using .net typed datasets to manage all the data, so I know I didn't mess up the code and leave a connection open. Any suggestions? Thanks,
0
2001
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 paging tools causes the GridView to completely disappear! This happens when either DataSets or DataTables are used (it doesn't work at all for DataReaders because they don't support paging apparently). If you remove the...
1
1351
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
1818
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 the url you see is not the page that is actually returned. To add to the complexity, I have a module which does a similar url rewrite at a higher level.
2
2199
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
8438
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8348
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8863
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8549
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7376
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6187
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
2765
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2004
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1761
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.