How to find the records which are not in a arraylist

The explanation is like below.
i have a arraylist which contains
arraylist _upsRange=new arraylist{}
_upsRange array list contains  {"13.11.2009","14.11.2009","18.11.2009"}.
iam building the datecodebasicobj lile below

foreach (IDateCodeBasicDTO val in lineDetails.DateCodeBasics)
                     DateCodeBasicDTO _dateCode = new DateCodeBasicDTO();
                     if (val.ItemDateCode != null)
                         _dateCode.CountUnitCode = val.CountUnitCode;
                         _dateCode.IouSize = val.IouSize;
                         _dateCode.ItemDateCode = val.ItemDateCode;
                         _dateCode.LayoutBcode = val.LayoutBcode;
                         _dateCode.LineNumber = val.LineNumber;
                         _dateCode.LocationCode = val.LocationCode;
                         _dateCode.Quantity = val.Quantity;
                         _dateCode.UpdTstmpField = val.UpdTstmpField;


datecodebasicobj {"10.11.2009","11.11.2009","12.11.2009"}."13.11.2009","14.11.2009","18.11.2009"}.
i need to find out  the records in datecodebasicobj which not in upsRange forecastlist.
the output will be {"10.11.2009","11.11.2009","12.11.2009"}
for (int i = 0; i <= _upsRange.Count; i++)
                var datecodelist = from d in datecodeBasicObj
                                   where d.ItemDateCode != _upsRange[0].ToString                                         select d;


pls help me and send the logic for the above code.

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


Here is the logic that you need, notice that the needed filtered values will be stored in a new list of strings called cleanList.

            List<string> cleanList = new List<string>();

            for (int i = 0; i <= datecodebasicobj.Count; i++)
                for (int x = 0; x <= _upsRange.Count; x++)
                    if(datecodebasicobj[i] != _upsRange[x])

If you see any compilation errors please tell me, and i will help you ...
Use LINQ "Except" method:

double[] numbers1 = { 2.0, 2.1, 2.2, 2.3, 2.4, 2.5 };
double[] numbers2 = { 2.2 };

IEnumerable<double> onlyInFirstSet = numbers1.Except(numbers2);

foreach (double number in onlyInFirstSet)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
n_srikanth4Author Commented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.