Solved

datagridview loading and unloading based on non binding sql queries

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
I have a large data set and a SSIS package. How can I load this file in multi threading?
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

856 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