You never declared infile. You either have to make it global, or to pass it as one of ReadData's arguments.
And compiler told you the same thing :)
that fixed those errors! but now there is these...
error C2039: 'open' is not a member of 'System::Int32'
error C2039: 'eof' is not a member of 'System::Int32'
infile has to be of type ifstream. You get that type from fstream.
Is this your code?