Hello,
for example you want to show person entity.
var people = context.People.Select(p=>p);
people = (people.Count()>=10)? people.Top(10): people.Top(people.Count());
foreach(Person p in people)
{
Label name = new Label();
name.Text = p.Name;
Label family = new Label();
family.Text = p.Family;
this.Controls.Add(name);
this.Controls.Add(family);
}
context is your whole database; if you don't know how to have it then forget it and use the collection that is storing the Person entity insted of
context.People
For example you have a
List<Person>
PeopleList
;
var people = (PeopleList.Count()>=10)? PeopleList.Top(10): PeopleList.Top(PeopleList.Count());
Maybe you need to set
Left
and
Top
of all
Label
s.
I've written the code by hand and I haven't tested it but the base is correct.