Tech or Treat! Write an article about your scariest tech disaster to win gadgets!Learn more

x
?
Solved

getting fields from a list<>

Posted on 2012-12-27
2
Medium Priority
?
265 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 2000 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn different types of Android Layout and some basics of an Android App.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

647 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