473,327 Members | 2,055 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,327 software developers and data experts.

Compare two datasets and remove datarows

I'm using two datasets DS1 & DS2 (both hold data with same schema) in VB.Net 1.1

DS1 is main datasets and DS2 is like subset to DS1.Now how should i remove datarows from DS1 that are like in DS2.

Thanks In Advance.
Sonymathur.
Jul 16 '07 #1
3 2141
If you have unique fields in each row, i.e. an "ItemNumber" then simply comapre them. I do something simililar in my program:

If <comparison logic of unique fields> Then
Dataset.Tables("table1").Rows.RemoveAt(rowindex)
End If

the rowindex was determined earlier in the program.

With more information I can give an example closer to your scenerio. I hope this helps you in figuring out your problem!!!

Cyberdaemon
Jul 16 '07 #2
If you have unique fields in each row, i.e. an "ItemNumber" then simply comapre them. I do something simililar in my program:

If <comparison logic of unique fields> Then
Dataset.Tables("table1").Rows.RemoveAt(rowindex)
End If

the rowindex was determined earlier in the program.

With more information I can give an example closer to your scenerio. I hope this helps you in figuring out your problem!!!

Cyberdaemon

Thanks for ur Help

I did the same as you explained but the problem is the dataset has around 5000 records and some 4994 row is missing in the dataset so how to check if all the data rows exist in the dataset or not ?

Thanks in Advance
Sonymathur
Jul 16 '07 #3
what do you mean you have 5000 records but 4994 are missing? could you post a code snippet of where your problems lies so I can further assist?
Jul 17 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

45
by: cody | last post by:
I've seen an Introduction on ADO.NET with its Datasets on .NET TV and Iam now wondering how it is realized/used in real world applications. I don't believe that one would create a dataset and add...
2
by: malcolm | last post by:
Hello, We have a robust (.NET 1.1 c# winforms) client-server application that utilizes many typed DataSets, typed DataTables and typed DataRows. Our application is a series of windows and popup...
4
by: Frank | last post by:
Hello, Developing an app where the user fills out a sometimes quite lengthy form of chkboxes, txtboxes, radbtns, etc. User responses are saved to a mySql db, which the user can later edit. When...
3
by: cj | last post by:
I've used datatables and datasets before. Datasets being able to hold more than one table and datatables being only one table. My mind keeps coming up with recordsets. I can't remember how they...
16
by: Luqman | last post by:
Is it recommended to use datasets in ASP.Net 2.0 / VS.Net 2005 ? Best Regards, Luqman
4
by: Ronald S. Cook | last post by:
I've always used untyped datasets. In a Microsoft course, it walks through creating typed datasets and harps on the benefits. It has you drag all these things around ..wizard, wizard, wizard......
3
by: =?Utf-8?B?UmljY2FyZG8=?= | last post by:
What is the best method to compare 2 array to knw if each element is equal? Now, i have to compare the datarow.itemarray of 2 datarows wich is equals in structure. I tried to write this routine:...
2
by: RB0135 | last post by:
Hi, I need to compare two complete datarows. In C# it is a simple matter of if (datarow1 == datarow2) .... But, if I try If DataRow1 = Datarow2 then.... I get an error stating that the...
5
by: Anil Gupte | last post by:
How can I manipulate Datasets, such as getting a specific row based on a key column value. Of course, I could loop through all the rows in the entire dataset each time I needed something, but is...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.