How to store a double array in one column (field) of a DataTable?
I want to have 2 data fields to keep in a row, the first one being an integer which is the ID of the product and the second one being a double array which contains all the different prices the product has had (evolution of the product's prices). How can I store these 365 prices of the product in the same row. Maybe I should use an array price
:
dtPriceOfProduct.Rows.Add(product_id, price)
where price
is an array of all the prices the product with product_id
can have. I want to have 1x5,000 rows not 365x5,000.
Currently I am storing data like this
int product_id;
double[] price = new double[];
and I create a new row in my DataTable for each price of the same product
foreach(double price_data in price)
{
dtPriceOfProduct.Rows.Add(product_id, price_data)
}