Convert a string to an integer:
string key = "123"; int i = int.Parse(key);
Convert an integer to a string:
int i = 23; String s = i.ToString();