Possible Duplicate:
How can I convert String to Int?
public List<int> GetListIntKey(int keys) { int j; List<int> t; t = new List<int>(); int i; for (i = 0; ; i++) { j = GetKey((keys + i).ToString()); if (j == null) { break; } else { t.Add(j); } } if (t.Count == 0) return null; else return t; } The problem is on the line:
j = GetKey((keys + i).ToString()); I'm getting error say:
Cannot implicitly convert type 'string' to 'int'
Now the GetKey function is type of string:
public string GetKey(string key) { } What should I do ?