i’ve downloaded from SQL database items to my datagridview, so i have 8 columns generated automataticaly.
What i’d like to do is to add values from column 5 and 6 to List.
So i’d like to have something like that but make from values from cells.
public List<Item> GetItems()
{
return new List<Item>(){
new Item(){Name = "Usage1", dat= DateTime.Parse("2012-03-06"},
new Item(){Name = "Usage2", dat= DateTime.Parse("2012-03-07"}};
}
public class Item
{
public string Name;
public datetime dat;
public Item()
{
}
}
How to do it?
You should be able to use a Linq-Objects query to extract the data from the Rows, then from the Cells in each row.