• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 268
  • Last Modified:

getting fields from a list<>

I have a list and it returns the data I need to fill a grid - but now I need to forward that information to a new page using stubs - I can do that but I cant figure out how to get the information from the list

            MyData.QC q = new MyData.QC();
            List<MyData.QCData> data = new List<MyData.QCData>();
            data = q.GetAllOpen(linekey, sample, tuid);
                foreach(string d in data)

Open in new window

this doesnt work  - the error is cannot convets list to string - I could use the help if anyone knows - Thanks R
1 Solution
käµfm³d 👽Commented:
You have a list of MyData.QCData, yet you are attempting to iterate over it as if it were a list of string. See the discrepancy there? Try:

foreach(MyData.QCData d in data)
    MessageBox.Show(d.SomePropertyOfQCDataClass);  // change accordingly

Open in new window

r3nderAuthor Commented:
Thanks K
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now