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

G

Guest

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top