I hope I am wording my question the right way, and using the correct terminology. I have an array of student names, arrSummary, that is distinct (no duplicates).
Then, I have another array, arrTest1, that contains a list of the same students’ names and their test scores on Test1. Then I have a third array, arrTest2, that contains a list of their names and their test scores on Test2.
arrTest1 and arrTest2 are such that arrTest1[0].Name = "Bob" and arrTest1[0].Score = "98".
How do I make the array, arrSummary, such that arrSummary[0].Name = "Bob", arrSummary[0].Score1 = "98", arrSummary[0].Score2 = "76"?
There are different types in the array (string, integer, integer).
Note that this is querying the first two arrays and creating a brand new array. Here I used an anonymous type for the query result; if the query results will be used outside of this method you’ll want to make a new class with those 3 properties and project the results to instances of that type (just put that type after
new).You can’t change the dimensions, the type, or even the size of an array once it is created. If the summary array already is of a type that has all three properties then you could in theory go through and populate it, but it would probably be easier to just generate the summary array from scratch, which is why that’s what I’ve done here.