My question is related to arrays in c#, or what I think is an array. I have a good knowledge in the basics of c# but not much after that.
I have been tasked to make changes to a piece of code below. The code retrieves a list of records from a web service and stores them in what I might be wrongly thinking is an array. Im not sure if arrays can have keys or "columns" like below (PurchaseDate, Location etc..). If not an array what is it?
OO_WebService.Sale[] saleList= OO_webService_connection.GetSales().Sales;
Console.Writeline(saleList[0].PurchaseDate);
Console.Writeline(saleList[0].Location);
Console.Writeline(saleList[1].PurchaseDate);
Console.Writeline(saleList[1].Location);
I also need to print out all keys or column names. For example there are another 20 keys along with PurchaseDate and Location. I want to be able to print out all key names(PurchaseDate) along with their values(01/04/2014 etc..) using a for loop, for example. I know it is possible in javascript. I have tried a few times but had no luck implementing it. Any suggestions greatly appreciated.