I'm trying to parse an element of a string array to an int.
Code:
public static void child_calc()
{
if (jw.totalcount == hk1Class.rows)
{ jw.linked = true; }
if (jw.linked == true)
{
linkedClass.linked_parent_setup();
// clone dictionary to enable converting to array
Dictionary<string, int> childcolor1 = new Dictionary<string, int>();
Dictionary<string, int> colorscopy = new Dictionary<string, int>(childcolor1);
// convert dictionary to array
int[] values = childcolor1.Values.ToArray();
string[] keys = childcolor1.Keys.ToArray();
// clone dictionary to enable converting to array
Dictionary<string, string> childgeneo1 = new Dictionary<string, string>();
Dictionary<string, string> geneocopy = new Dictionary<string, string>(childgeneo1);
// convert dicitionary to arry
string[] keys1 = childgeneo1.Keys.ToArray();
string[] values1 = childgeneo1.Values.ToArray();
// setting up the print parameters
int z = 0; //local var
while (z < (jw.totalcount + 1))
{
// calculate color type %
string dz = childcolor1[z, 1]; // copy array value to local string
int colorpct1 = Int32.Parse(dz); // copys array value to local int
colorpct1 = ((colorpct1 / jw.totalcount) * 100); // converts to a percentage
jw.colorpct = colorpct1; // converts the int to a string so % sign can be appended
// append % to end of string
string pct2 = "%";
jw.colorpct += pct2;
// print to screen
Console.WriteLine("{0}, {1}, {2},",
childcolor1[z, 0],
childgeneo1[z, 0],
jw.colorpct);
} // end while
} // end if
return;
} // end child_calc
this line is throwing the no overload error:
Code:
string dz = childcolor1[z, 1]; // copy array value to local string
My end result is to have converted 'string dz' to an int.
What am I missing?