Wrox Programmer Forums
|
VB.NET 2002/2003 Basics For coders who are new to Visual Basic, working in .NET versions 2002 or 2003 (1.0 and 1.1).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET 2002/2003 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 12th, 2004, 02:23 PM
Authorized User
 
Join Date: Mar 2004
Posts: 61
Thanks: 0
Thanked 0 Times in 0 Posts
Default Data Grid

I have an app that displays the contents of a dataset in a datagrid after a sub routine is called on it. The subroutine is called by clicking a button. The first time the button is clicked the data displays correctly in the data grid. After subsequent clicks, the data is changed in the dataset but the old results continue to show up in the data grid. Any idea on how I can remedy this?
 
Old August 12th, 2004, 03:17 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 540
Thanks: 0
Thanked 4 Times in 4 Posts
Default

Try clearing the datagrid using:

[DataGridName].DataSource = Nothing

Then add the new data back in.

J
 
Old August 13th, 2004, 09:29 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,101
Thanks: 0
Thanked 2 Times in 2 Posts
Default

WHen the data changes on the backed for the dataset, you need to rebind it.


Hal Levy
Web Developer, PDI Inc.

NOT a Wiley/Wrox Employee
 
Old August 16th, 2004, 09:37 AM
Authorized User
 
Join Date: Mar 2004
Posts: 61
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Neither of these worked. It is rather odd. If I set it to a specific table in the dataset it works just fine. When I set it to the dataset as a whole it will refresh every table but the one that was last viewed before new data was brought in. I tried playing around with the data member property didn't seem to make a difference either.
 
Old August 16th, 2004, 02:59 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,101
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Yes, you need to disconnect the dataset and rebind it to the control. and then refresh it.


Hal Levy
Web Developer, PDI Inc.

NOT a Wiley/Wrox Employee





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to sort data in a data grid? zaheerabbas.sk ASP.NET 1.0 and 1.1 Basics 3 April 10th, 2007 02:37 PM
Export data from data grid to excel pomoc VB.NET 2002/2003 Basics 0 December 16th, 2005 03:11 PM
Export data from data grid to Excel pomoc Visual Basic 2005 Basics 0 December 16th, 2005 02:56 PM
trying to load db data into data grid itsajourney Beginning VB 6 2 June 7th, 2005 12:05 PM
About data grid Asteroid ASP.NET 1.0 and 1.1 Basics 4 December 9th, 2004 05:42 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.