I have a list which contains some values, now I want to get all the data where ID is in the array with the values. The problem right now is that I only get 1 result while there are 13 integers in the array, so it doesn't loop.
This is my code: where messages is the array with integers.
List<string> messageList = new List<string>();
foreach (string i in messages)
{
Recordset Persons = SDK.Create("R_PERSON", "", "PK_R_PERSON = "+i ,"" );
if (Persons != null && Persons.RC > 0)
{
Persons.MoveFirst();
do
{
string firstname = Persons.Fields["FIRSTNAME"].Value.ToString();
string lastname = Persons.Fields["LASTNAME"].Value.ToString();
personmessages.Add(firstname);
personmessages.Add(lastname);
PersoninboundSet.MoveNext();
}
while (!PersoninboundSet.EOF);
}
return personmessages;
}
messages.Add("Error, didn't work.");
return messages;// null;
Can someone tell me what I'm doing wrong?