Solved

getting fields from a list<>

Posted on 2012-12-27
2
246 Views
Last Modified: 2012-12-27
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)
                {
                MessageBox.Show(d);
                }

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
0
Comment
Question by:r3nder
2 Comments
 
LVL 74

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 38724202
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

0
 
LVL 6

Author Closing Comment

by:r3nder
ID: 38724246
Thanks K
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

This is an explanation of a simple data model to help parse a JSON feed
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
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…

707 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

18 Experts available now in Live!

Get 1:1 Help Now