Solved

datagridview loading and unloading based on non binding sql queries

Posted on 2014-09-22
3
352 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

920 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

16 Experts available now in Live!

Get 1:1 Help Now