I have a sql database that is written to on a daily basis by some c# code, which contains stock information on a particular date.
Fields: StockCode, NumberOfHolders, Value, Date
Each day there is a new record added to the database with a date stamp.
I need to be able to create a list which is in the following format;
date1 date2 date3
stock1 100 104 110
stock2 105 100 99
stock3 150 150 80
etc.
However, this list would seems to have to be dynamic, as the fields would change, depending on the number of dates in the system for each stock.
So I could not use a class such as;
private class Stocks: ExcelReport
{
public String StockCode { get; set; }
public Double TotalQtyHeld { get; set; }
public Double TotalValueOfStock { get; set; }
public DateTime Date { get; set; }
}
Any help appreciated.
Thanks
Couldn’t you create a class that can hold the dates and values like this: