Solved

List to list

Posted on 2014-10-21
2
124 Views
Last Modified: 2014-10-22
I am trying to find a list in a list of lists
and transfer that list to an other list
but I get the error Cannot implicitly convert type myServer..DownholeEquipment to systems.Collection.Generic.List<myserver..DownholeEquipment>
anyone know why/

 DownholeEquipmentView = new List<myServer.DownholeEquipment>();
            var results = currentDownholeEquipment.Find(c => c.ID == (uint)index);
            DownholeEquipmentView = results;//myServer.GetDownholeEquipment(index);

Open in new window

0
Comment
Question by:r3nder
2 Comments
 
LVL 32

Accepted Solution

by:
it_saige earned 500 total points
Comment Utility
Probably better to use something like:
DownholeEquipmentView = new List<myServer.DownholeEquipment>();
DownholeEquipmentView = (from equipment in currentDownholeEquipment where equipment.ID == (uint)index select equipment).ToList();

Open in new window


-saige-
0
 
LVL 6

Author Closing Comment

by:r3nder
Comment Utility
Thank you IT worked like a chanp
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This is an explanation of a simple data model to help parse a JSON feed
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now