Hi guys thanks for your help in prior.
I`m not a programmer, i just try to solve a problem that costs me a lot of time each time i have to do it manually so if it`s stupid be gentle please.
Here is what I try to do:
I have a csv-outputs from a database with sales figures including all kind of transactions.
I now try to come up with a littke tool that just sums up the sales and costs for each customer and writes that info back to excel.
I figured out how to read the csv-file, how to put the data into a datatable as well as how to show them via datagridview, managed to filter
If i knew the customers in prior this would be quite easy, but its different for each month/year) so i try to figure out a way to get all the customers in the current file so i can write a loop which sums the numbers up for each of them.
What I have tried:
So far i have the data itself in a datatable and use a bindingsource to show the data in a datagridview.
I don`t link the datagridview direct to the datatable because I need the option to filter for time periods that i want to analyse.
which i do like this:
bs.Filter = "[Datum Status] >= #" + anfang.ToString("MM dd yyyy")
+ "# AND [Datum Status] <= #" + ende.ToString("MM dd yyyy") + "#";
dataGridView2.DataSource = bs;
I would now love to have something like:
foreach (string s in customerArray)
{
bs.compute("SUM([Salesvalue])");
}
But first i need to populate that array somehow with the values for the different customers.
>> Some customers have just one row in the data, others have a lot of them.
I just can`t get the loop right so it puts the different customers just once in the array.
What i need is something similar to this (syntax is wrong i know):
foreach (row in bs)
{
if (Customervalue is not in customerArray yet)
{
put cellvalue as string in the array
}
}
Maybe one of you can help me there?
Thanks a lot and have a nice christmas time :)