Rajat_16
(Rajat Pandit)
October 22, 2019, 10:45am
1
How can I retrieve key and value of a dictionary and store key and value in a different variables.
I have a dictionary of Key as string and Value as array of Int32. I want to extract key and value
I am using a for each loop to retrieve a single data at a time.
So, I am facing error in getting data for key
1 Like
HareeshMR
(Hareesh Madasi)
October 22, 2019, 11:01am
2
Can you hover the error icon and post the message you have there @Rajat_16 ?
I hope you are trying to assign a wrong data type value
HareeshMR
(Hareesh Madasi)
October 22, 2019, 11:55am
4
Sorry for so many questions, can you post the data type of Date_value, if it is a string, then you won’t get that error
vilardelld
(Daniel Ramos)
October 22, 2019, 12:07pm
5
Hello Rajat,
Why don’t you try using a For Each with your dictionary and see the index of the items that you want?
For example; item(0).ToString MAY BE your Key as an string
item(1).ToString may be one of the values that you want as an string
I think that may solve your problem.
Give it a try and tell me!
Kind regards,
Daniel
Hi @Rajat_16 ,
You have to do two things:
First:
When you are assigning value to Date_Value then in that time please convert the key value to ToString.
Dict_Month_Date(Key.ToString)
Second:
To iterate through each and every item of Int32 you have to introduced one more for each.
Attaching XAML for your reference.
Main.xaml (7.7 KB)
If it solves your query then please mark it as a solution.
Thanks.
Rajat_16
(Rajat Pandit)
October 22, 2019, 3:54pm
7
I have already tried that. Basically the Date_Value should be an array of Int32 with dates of the month in it. All i want to is to get those that values based on key which are months
system
(system)
Closed
October 25, 2019, 4:39pm
10
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.