private void setup() { ObjectFactory factory = ObjectFactory.getInstance(); factory.setMainForm(this); catalog = factory.getCatalog(); query = (QueryBase)factory.create("query"); conn = (ConnectionBase)factory.create("connection"); conn.setConnString(ProjectVariables.getConnectionString()); query.setConnection(conn); try { conn.Connect(); string selectQ = "SELECT * FROM students"; query.setSQL(selectQ); query.executeQuery(); int i = 0; query.first(); while (!query.eof()) { Student student = new Student(); student.Id = query.getFiedValueINT("ID"); student.Name = query.getFiedValueSTRING("NAME"); student.Surname = query.getFiedValueSTRING("SURNAME"); student.BirthDate = query.getFiedValueSTRING("BIRTH_DATE"); catalog.add(student); Console.WriteLine(i); i++; query.next(); } } catch (Exception ex) { System.Windows.Forms.MessageBox.Show("Setup error:" + ex.ToString()); } finally { conn.Disconnect(); } }