Try this:
int LineNo = 0;
while ((number = s.ReadLine()) != null)
{
lineNo++;
int n = 0;
bool didConvert = int.TryParse(number, n);
if(didConvert)
{
array[item] = n;
item++;
}
else
Console.WriteLine("Line {1}: Could not convert {0} to an int!", number, lineNo);
}
Cheers
Manfred