How can I add a record to Key Value pair collection type? In Dictionary, you can use ‘Add to dictionary’ method but I am not able to find similar method for Key Value Pair collection type? I want to run a for each loop through all the items in collection and print key value pair.
You have the constructor for the same,
new KeyValuePair(key, value)
#nK
Hello @aditi1
Below video might help you:-
Mark as a solution and like it if this helps you
Happy Automation
Best Regards
Er Pratik Wavhal
@Pratik_Wavhal I have already used this method but this is for dictionary. I am using key value pair in my script which is different from dictionary.
System.Collections.Generic.KeyValuePair<String, String>
@Palaniyappan I had already seen this post and tried to use this yourdicitionaryvariable(“yourkeyname”) = “yourvalue” but it didn’t work for me. It throws me an error. I am using C# in my script not VB and this is not supported in C#.
Thanks @Yoichi . I was close to this only and you post just helped me.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.