Hi, here I was trying to manipulate the dictionary variable to string.Could some help me whay I am getting this error.
Put .ToString after the object variable
Still same error. But when I done before it was fine.
Hi @Pushpendra_kowthavarapu
In your case, you can use only ‘dict’ in your for, and t
o retrieve de value of key, you can use currentItem.Value. Examine this example
Can you show the current script that you are using in assign
Also as mentioned above you can directly use dictionary in the for loop ans use currentitem.value and currentitem.key
Cheers
Please shwo the expression you have inside the assign
May be name is not recognized
Try dict(name.ToString)
Cheers
May be when the value is changed the for loop auto casted name to object instead of string…ao try with dict(name.ToString)
Cheers
Instead of datetime.Parse use datetime.ParseExact
DateTime.ParseExact(dict(name).ToString,"Your Format",CultureInfo.InvariantCulture)
import System.Globalization
as per error the value in dictionary for one of the key is empty , a blank string…check that
cheers
Thanks for the suggestion. I will do it .
Hi, I tried it but still not working .
Try this way:
Assign-> DicVar = New Dictionary(of String,String)
Assign-> DicVar("Varun") = "08-11-2000"
For Each currentKeyValuePairOfTextAndText in DicVar
Assign-> str_Date = DateTime.ParseExact(currentKeyValuePairOfTextAndText.Value, "MM-dd-yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("MM-dd-yyyy")
End For Each
DicVar
is of DataType System.Collections.Generic.Dictionary(System.String,System.String)
. str_Date
is of DataType System.String
.
If you have more queries, I’m happy to help.
Regards