Peter Williams

Peter Williams

  • NA
  • 2
  • 464

Best use of arrays

Jan 24 2019 11:31 AM
Hi 
I have justed signed up because this seems to deal with c#.
I am using visual Studio 17 & c# and writing my own 'practice programs'
 
I have read many different responses to 'global arrays' and understand not the bestt way to go.
 
IF I have a banking data file with:-
  1. Date DateofT
  2. StringT Text of transaction - CCARD PAYMENT TO ASDA SUPERSTORE.....ETC
  3. Double ValueIN = monies paid IN
  4. Double ValueOUT = monies paid OUT
How would I best define / declare / structure this data rather than using a mult- dimensional globle type array.
 
I'd wish to read data into the above in one routine - say - i.e. hit Button to Read Data from File
 
I'd wish to interrogate data:-
  • all transcation between date 1 and date 2 
  • all transactions contain ASDA
  • write my data to a listbox
  • from the listbox - to printer or file if required
sort of think mydata.DateofT, mydata.StringT etc with the nth item in each list being all part of the same initial line of data.
 
Hope this makes sense. My project starts like this
  1. namespace MyTestingDesktop  
  2. {  
  3.     public partial class MyTestingDesktop : Form  
  4.     {  
  5.         public MyTestingDesktop()  
  6.         {  
  7.             InitializeComponent();   
  8.         }  
 Any guidance really appreciated
 
 
 

Answers (1)