This is my function.
public Dictionary<string, string> ArrayToDictionaryConverter(object [] objArray)
{
string[] strArray = new string[objArray.Length];
strArray =(string[])objArray;
Dictionary<string, string> dictionary = null;
try
{
dictionary = new Dictionary<string, string>();
for (int iVal = 0; iVal < strArray.Length; )
{
dictionary.Add(strArray[iVal], strArray[iVal + 1]);
iVal += 2;
}
}
catch (Exception ex)
{
}
return dictionary;
}
Getting error :
Unable to cast object of type 'System.Object[]' to type 'System.String[]'.
Why ? is this wrong convention / Casting?