PFA,
I have an Excel sheet it contains two columns part number, qty
I am trying to store all the part number values into one array/list/dictionary & all Qty values array/list/dictionary
Can anyone guide me on how to do that
Thanks in advance
PFA,
I have an Excel sheet it contains two columns part number, qty
I am trying to store all the part number values into one array/list/dictionary & all Qty values array/list/dictionary
Can anyone guide me on how to do that
Thanks in advance
Hi @rsr.chandu ,
You can use the below expression to convert it to dictionary:
DT.AsEnumerable.ToDictionary(Function(x)x("partnumber").ToString,Function(y)y("quantity").ToString)
Regards,
Hi,
If partnumber is unique in the table, I recommned to use Dictionary as the following.
dict = dt.AsEnumerable.ToDictionary(Function(r) r("partnumber").ToString,Function(r) r("quantity").ToString)
note : dict is Dictionary<string,string>
type
Regards,
How to loop through the created dictionary?
How to check whether it is empty or having some values
You can use the for each item and an if condition inside to check whether the key or value is null/empty
Regards,
Hi,
We can check it using Count property as the following.
Regards,
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.