Can anyone help me to convert datatable to dictionary of array
I’ve list items in datatable format. I need to convert it to dictionary of array variable
Can anyone help me to convert datatable to dictionary of array
I’ve list items in datatable format. I need to convert it to dictionary of array variable
Hi @Aarya_Sajeev ,
Could you maybe check with the below post :
Can you please show your final output needed
What should be the key and what should be the values?
cheers
dt1.AsEnumerable.ToDictionary(Function(x) x(0).tostring,Function(x) DirectCast(x(1),String()))
dataDict(CurrentRow("S.NO").ToString())=CurrentRow.ItemArray
Variables
Hope it helps!!
Create a dictionary and initialize it
dictionary = New Dictionary(Of String, Object())
Use assign activity
dictionary = dt.AsEnumerable().ToDictionary(
Function(row) row(“YourKeyColumnName”).ToString(),
Function(row) row.ItemArray)
Hope this helps