Hi,
Please would someone help me. I have a list of a class (QaUserEntity) in a list called targetList. I want to loop through the list and extract each item individually so that I can get to the elements of the class so that I can populate a listbox with
a single string.
This is what I have so far... The problem lies in the line of code 'userEntity = targetList.IndexOf(i);' The i is highlighted and it tells me - Error
CS1503
Argument 1: cannot convert from 'int' to 'QIAS.Business.Entities.QaUserEntity'
private void LoadUserNames(List<QaUserEntity> targetList)
{
int listCount;
string resultString = "";
listCount = targetList.Count;
for (int i = 0; i < listCount; i++)
{
QaUserEntity userEntity = new QaUserEntity();
userEntity = targetList.IndexOf(i);
resultString = userEntity.FirstName + " " + userEntity.Surname + " " + userEntity.LogonName + " " + userEntity.UserID;
lstResult.Items.Add(resultString);
}
}
Many Thanks,
Sue