Home All Groups Group Topic Archive Search About

Doubling up of data in DataView-bound DataGrid??

Author
19 Sep 2006 3:51 PM
Nate
Before I go through posting a lot of code, a quick question ... Has
anyone come across a problem with a DataView showing duplicates of the
desired data? I'm querying a SQL table and the DataView (or grid) keeps
adding the same subset of data each time I refresh the view.

Thanks in advance!

Author
19 Sep 2006 5:26 PM
Cor Ligthert [MVP]
Nate,

If you do a Fill and not clear the dataset or the table in advance, than
those will be filled again.

The dataview is only showing things that are in a datatable.

I hope this gives an idea,

Cor

Show quoteHide quote
"Nate" <howlsatfullmo***@gmail.com> schreef in bericht
news:1158681111.267884.285530@m73g2000cwd.googlegroups.com...
> Before I go through posting a lot of code, a quick question ... Has
> anyone come across a problem with a DataView showing duplicates of the
> desired data? I'm querying a SQL table and the DataView (or grid) keeps
> adding the same subset of data each time I refresh the view.
>
> Thanks in advance!
>
Author
25 Sep 2006 2:35 PM
Nate
Cor,

Thanks for your reply. I checked the table that the View is bound to
(using DV = DT.DefaultView) while running the app, and it has only one
copy of the data that shows up in duplicate. Also, if I clear either
the DataSet or Table, nothing shows up in the View at all (although all
the data is in the Table at the time).

So I'm thinking it's something in my RowFilter... although, how would
*that* show two copies of the rows? I even set it to the empty string
before setting the filter.

Nate
Author
25 Sep 2006 3:11 PM
Izzy
Try putting this line of code first in the sub where you load the
table.

If Dataset.Tables.Contains("TableName") Then
Dataset.Tables("TableName").Clear()

Hope this helps,
Izzy


Nate wrote:
Show quoteHide quote
> Cor,
>
> Thanks for your reply. I checked the table that the View is bound to
> (using DV = DT.DefaultView) while running the app, and it has only one
> copy of the data that shows up in duplicate. Also, if I clear either
> the DataSet or Table, nothing shows up in the View at all (although all
> the data is in the Table at the time).
>
> So I'm thinking it's something in my RowFilter... although, how would
> *that* show two copies of the rows? I even set it to the empty string
> before setting the filter.
>
> Nate
Author
25 Sep 2006 9:00 PM
Nate
Thank you both.... clearing the Table cleared things up!

The trick was figuring out where to put the Clear(); do to the UI
having a few TabPages (and the Clear needing to go into a specific
TabPage Click but not others), it got a bit tricky.

Nate