473,378 Members | 1,507 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Doubling up of data in DataView-bound DataGrid??

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!

Sep 19 '06 #1
4 1004
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

"Nate" <ho**************@gmail.comschreef in bericht
news:11**********************@m73g2000cwd.googlegr oups.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!

Sep 19 '06 #2
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

Sep 25 '06 #3
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:
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
Sep 25 '06 #4
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

Sep 25 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: GeraldBauer | last post by:
I am experiencing some weird behaviors with the listbox and dataview. Here is a boiled down code snippet of what I am trying to do. <snippet> string MENUID = "MenuId" , ITEM = "Item" ,...
2
by: Guoqi Zheng | last post by:
Dear sir, New to ASP.NET, help will be appreciated. I need to create a XML file for product feed. In our business, one product always belongs to more than 1 categories. I need to have a XML...
0
by: RyanG | last post by:
when the value that determines the filter is databound?? I am trying to make a DropDownList for a set of data that I use a lot throughout my project. So I extended the DropDownList to retrieve...
6
by: Patrick.O.Ige | last post by:
Hi guys, Just using these small snippet below using Datalist with sorting! But it appears i can see no Data on the screen when compiled with Visual Studio .Net! With WebMatrix its running fine!:)...
1
by: ReidarT | last post by:
I use a dataview to view records from an sql-database in a windows-form. When I use a select statement from a table like SELECT * FROM Table1 it works ok. objDataAdapter.Fill(objDataSet, "Table1")...
0
by: Henry | last post by:
My DataTabel has the following columns: org_id, org_name, parent_id DataTable dt = dsMyData.Tables; This next statement should create a data view with filter that results in one row ...
7
by: | last post by:
Hello, Does anyone have an idea on how I can filter the data in the gridview control that was returned by an sql query? I have a gridview that works fine when I populate it with data. Now I...
4
by: Terry | last post by:
Hi, I am both new to .Net (coming from VB6 and DAO) and to this news group. I am trying to convert some code from VB6 that uses a "record set" to help the user locate a specific record. As the...
0
by: DC01 | last post by:
I have added a new measure successfully into the normal cube. I then add it to the virtual cube and reprocess all cubes. I can browse the normal cube successfully. Then when I try and browse the...
18
by: Brock | last post by:
I'm trying to develop a web service to expose an XML file for product manufacturers for a client application to consume and populate a datagrid on the consuming end. I have successfully tested...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.