Im trying to store to array of ints in a jagged array:
while (dr5.Read()) { customer_id[i] = int.Parse(dr5["customer_id"].ToString()); i++; } dr5 is a datareader. I am storing the customer_id in an array, i also want to store scores in another array. I want to have something like below within the while loop
int[] customer_id = { 1, 2 }; int[] score = { 3, 4}; int[][] final_array = { customer_id, score }; Can anyone help me please ? EDIT: this is what i have tried. No values are being displayed.
customer_id = new int[count]; score = new int[count]; int i = 0; while (dr5.Read()) { customer_id[i] = int.Parse(dr5["customer_id"].ToString()); score[i] = 32; i++; } int[][] final = { customer_id, score }; return this.final;