First, you should use a generic list. Non-generic collections are obsolete.
Second, it is not possible to edit objects of anonymous types, they serve only for reading. That is, if you want to edit some property it is better to create a class.
public class Business
{
public string Name { get; set; }
public string OwnerId { get; set; }
}
There you can create the list this way
var list = new List<Business>();
list.add(new Business
{
Name = reader.getString("name"),
OwnerId = reader.getString("owner_id")
});
From then on, you will be able to access the list by the indexes
var business = list[0];
business.Name = "Novo Nome";
Iterating on the elements
foreach(var business in list)
{
business.Name = "Novo Nome";
}
Or even using LINQ
var business = list.FirstOrDefault(b => b.Name == "Nome Antigo");
business.Name = "Novo Nome";
About the dynamic list: I did not understand very well why you put it loose in the question, but I advise to give a read in the answers to this question.
I’m on my cell phone so it’s kind of hard to write code. Anything, just comment that I fix when I have access to a computer.
– Jéf Bueno