I used it but it seems that duplicate the last row only ? I don’t understand why ?
for each to loop through Dt lists , then inside of it another for each to loop through rows in each Dt , so inside of it I add the Append item to list , but it duplicate the last row as the same number of Dt rows ?
Canypu tell what you are trying to achieve…first you havr a list or you create a list of datatable and now your loop through each and then in each you are looping through each row…and adding to collection?
If you want each of the group as a separate item in bulk_Data then each should have a different key and also you have to re initilaize the array_list1 as for each group it should have new data and each new data should be a different key…for changing key you can append count to the key string
here the grouped data is clubbed back again as for each datatable the array_list1 is still having old data and after creating list after each datatble the data is getting re written to same bulk_data key value in the dictionary of bulk_data…
Instead if you need a dictionary of bulk_data for each color combination…then you can either use color as key or change key by using count in the bulk_data dictionary key …like this bulk_data(“Bulk_data” +Count.ToString)
about the dattables which are created by grouped by color … this is not necessary it could be by a specific number , let say each 2000 rows in separate DT … because I will handle a huge amount of rows more than 20,000 rows …
So for each iteration of datatable in datatableList
I will have the Json format I need ( only one key bulk_dat )
But it is not getting separated…as the array is getting appended always… inside both loops…so even if you are dividing into 2000 rows still at the end in array 2000 are combined any made in 20000…if that is needed then youneed not do all these loops…