Click here to Skip to main content
15,897,187 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
how to get the values from List in C#?
Posted
Comments
walterhevedeich 6-Aug-11 0:56am    
What have you tried? Any code?
RaisKazi 6-Aug-11 0:57am    
Do you mean from object of "System.Collections.Generic.List" or from ListBox Control?

Here is a link which may can help you:
[list]
 
Share this answer
 
It might be helpful,

C#
static void Main(string[] args)
{
    var dataToFind = "One";
    Console.WriteLine(Find(dataToFind));
}
private static string Find(string dataToFind)
{
    IList<string> myList = new List<string>() { "One", "Two", "Three" };
    return myList.Where(item => item.Equals(dataToFind)).FirstOrDefault();
}


:)
 
Share this answer
 
code below


i resolved the problem based on below code.


foreach(Modelclass rec in bizclass.Callfn())
{
string id= rec.fieldname();
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900