473,320 Members | 1,802 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,320 software developers and data experts.

How to merge 2 IList collections?

Can anyone show me how to cleanly merge 2 IList collections? Keeping
only unique items from the 2 lists?

--David
Nov 16 '05 #1
1 15497
Hi David,
Can anyone show me how to cleanly merge 2 IList collections? Keeping
only unique items from the 2 lists?
Let's assume List1 is the first list, List2 the second:

=======
foreach ( object o in List2 )
if ( !List1.Contains( o ) )
List1.Add( o );
=======

Regards,

Frank Eller

--David

Nov 16 '05 #2

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

Similar topics

4
by: emma middlebrook | last post by:
Hi Straight to the point - I don't understand why System.Array derives from IList (given the methods/properties actually on IList). When designing an interface you specify a contract. Deriving...
13
by: cody | last post by:
why arent there some util functions for IList for example Sort()? -- cody Freeware Tools, Games and Humour http://www.deutronium.de.vu || http://www.deutronium.tk
4
by: KC | last post by:
Could some one explain to me the casting rules for sending generic lists, ex. List<Person>, to a function that accepts List<object>? I cannot get the following easy-cheesy app to work. I get the...
3
by: ad | last post by:
Hi, When I studied CSharp, I am confuse by IList, Collection and Array. What is the relationships between them?
6
by: Bern McCarty | last post by:
I'm trying to use the VS 2005 March Tech Preview and am trying to adjust some MC++ to the new C++/CLI syntax. I got a little hung up when I encountered the below error. Certainly my...
2
by: Lucian Wischik | last post by:
Does ReadOnlyCollection<T> really implement IList<T>, like it claims to do? ... When I right-click on ReadOnlyCollection and look at its definition, it says this: public class...
4
by: Rene | last post by:
According to the documentation, the List<T> type explicitly implements the non generic IList interface. The problem is that no matter how hard I look, I am not able to find this implemetion on...
2
by: Paul | last post by:
I have two classes. One (FrontierApplication) is a definition of a record from a table. The other (FrontierApplicationCollection) is the collection of the first class. Below is how they are...
5
by: dhivya1 | last post by:
Hi, Is it possible to get the results of HQL queries in DataSet?.I want to display results of HQL query to GridView. As HQL results are returned in the form of IList/List collections i am...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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...
0
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: 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: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.