Untested, off the top of my head: perform until not dr::Read declare aStudent = new Student set aStudent::ID to dr::GetInt32(dr::GetOrdinal("ID")) set aStudent::Name to dr::GetString(dr::GetOrdinal("Name")) set aStudent::DateOfBirth to dr::GetDateTime(dr::GetOrdinal("DateOfBirth")) invoke student::Add(aStudent) end-perform That's not how I'd actually implement this method (I'd use the COBOL.NET portable list syntax and I'd refactor the GetOrdinal invocations out of the loop), but it ought to work.
↧