Consider a Winforms app connecting to a SQL Server 2008 database and running a SQL SELECT
statement:
string myConnectionString = \"Provider=SQLOLEDB
You can try something as (adapt it for your convenience):
public class Person
{
public string Name { get; set; }
public int Age { get; set; }
}
List dbItems = new List();
while(myReader.Read())
{
Person objPerson = new Person();
objPerson.Name = Convert.ToString(myReader["Name"]);
objPerson.Age = Convert.ToInt32(myReader["Age"]);
dbItems.Add(objPerson);
}