Solved

datagridview loading and unloading based on non binding sql queries

Posted on 2014-09-22
3
350 Views
Last Modified: 2014-09-23
I have a datagridview1 where I load it with a sql statement and I used datagridview1.datasource =nothing then clear and clearselection This will clear the datagridview1  I repopulate the datagridview comes up with 2 records for every 1 record if I run it a third time the datagridview comes up 3 times for that 1 record is there a way to just havethe datagridview just load data once I assume the dataset is not being destroyed. That's another thing if a user selects a certain team that dataset I cannot change. How do I release a dataset and repopulate it
0
Comment
Question by:powerztom
3 Comments
 
LVL 8

Expert Comment

by:Ganapathi
ID: 40338372
What statement you used for this "datagridview1.datasource =nothing then clear"? Can you post your code snippet?
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
ID: 40338683
Do you reinitialize the datatable/dataset as well? Add following before your .Fill method call

YourDataTableName = New DataTable

or

YourDataSetName = New DataSet
0
 

Author Closing Comment

by:powerztom
ID: 40339247
CodeCruiser:, Thank You  I'm Happy now I can use this in more places in project.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now