I have a dictionary from which I like to create a multidimensional array through c#.
foreach (KeyValuePair<string, int> pair in rptdata)
{
string s2 = pair.Key;
int s1 = pair.Value;
// var ccdata1 = new[] { new object[] { "Item1", 1 } };
// object value = cdata1[s1,s1];
}
I need to add code inside the foreach look so that it can create something like the following:
var ccdata = new[] { new object[] { "Item1", 1 }, new object[] { "Item2", 2 } };
Note that Item1,Item2 would come from str1 and 1,2 would come from int1.
I am not sure how to iterate though to populate the multidimensional object array.