I'm quite new into C# and right now I'm totally stuck into this function. Any help would be appreciated.
I'm getting an OutOfMemoryException on  mess.Add(firstname);
I'm pretty sure it's because of an array fault but I can't seem to make it work.
Who can guide me in the right way?
This is my code so far:
 public List<string> SelectEmployee(string pkrelation)
        {
        SDKRecordset inboundSet = IQSDK.CreateRecordset("R_CONTACT", "", "FK_RELATION = " + pkrelation, "");
        inboundSet.MoveFirst();
        string person = inboundSet.Fields["FK_PERSON"].Value.ToString();
        messages.Add(person);
        inboundSet.MoveNext();
        SDKRecordset inboundSet2 = IQSDK.CreateRecordset("R_PERSON", "", "PK_R_PERSON = " + person, "");
        if (inboundSet2 != null && inboundSet2.RecordCount > 0)
        {
            inboundSet2.MoveFirst();              
            do
            {
                string firstname = inboundSet2.Fields["FIRSTNAME"].Value.ToString();
                mess.Add(firstname);
                inboundSet.MoveNext();
            }
            while (!inboundSet2.EOF);
            return mess;
        }
        messages.Add("Error, didn't work.");
        return messages;// null;