For each loops for dictionary (of integer, dictionary (of string , datatable))

Hi, I have 2 dictionaries.
a) Dictionary (of string, datatable)
b) Dictionary (of integer, dictionary (of string, datatable))

Dictionary a) is stored in dictionary b).
Then I wanted to create excel files for each keys in dictionary a), then write each datatables into different sheets in excel files for each keys in dictionary b)

This is the for each loop for dictionary b)


And within this for each, I have another for each loop for dictionary a)

As you can see it is having validation errors

Instead of dictionary.Value you should use dictionary.Values.

Refer the links below

https://stackoverflow.com/questions/141088/what-is-the-best-way-to-iterate-over-a-dictionary

Kindly Change the type of first for each loop to datatable and try buddy…
Cheers…

Yes, I just realized the first for each loop should be
KeyValuePairs (Int32, System.Collections.Generic.Dictionary (String, Datatable)) instead of KeyValuePairs (Int32, KeyValuePairs(String,Datatable))

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.