I am making a pay roll app for a class project, I have most of it under control but I am stuck on trying to search my text file, (using stream writer/reader) I need to Develop Method to search the personal list details for Employment ID (eg 101) and individual pay rate (e.g. $20 per hour) however I am stuck on just looking up employment ID. I will post my code not sure If I should post it all, or just where the error is, I will start with where the error is.
the error I am having seems to be with the private List<string>string SearchbyName;
( with the error:
'PayRoll.SearchbyName(string, List)': not all code paths return a value
Sorry if this is not correct way to do this but any help would be great as this project is due end of the week and I cant progress anymore till I fix this thank you. (this is a windows form app)
private List<string> SearchbyName(string term, List<string> PeopleList)
{
List<string> results = new List<string>();
for (int i = 0; i < PeopleList.Count; i++)
{
if (PeopleList[i].Contains(term))
{
results.Add(PeopleList[i]);
}
}
if (results.Count == 0)
{
results.Add(term + "not Found");
}
}