Hi All,
I am trying to get the following to work:
TexationJobsEntities de = new TexationJobsEntities();
var operatives = from o in de.Operatives
select new {o.OperativeID, o.First_Name, o.Last_Name};
foreach (var operative in operatives)
{
operativesListBox.Items.Insert(operative.OperativeID, operative.First_Name + " " + operative.Last_Name);
}
|
Its very weird as the list box remains empty. but the following works fine (apart from the fact that the entries are not in sync with the source database)
TexationJobsEntities de = new TexationJobsEntities();
var operatives = from o in de.Operatives
select new {o.OperativeID, o.First_Name, o.Last_Name};
foreach (var operative in operatives)
{
operativesListBox.Items.Add(operative.First_Name + " " + operative.Last_Name);
}
|
anyone have any ideas ?
Thanks in advnace
Regards
Ore
Suthish NairPosted Oct 24, 2010, 2:59 AM
Paul ChambersPosted Oct 24, 2010, 6:52 AM
Thanks for the replies. I tried the breakpoint previously and everything seemed to be working but the list box just remained blank.
I tried your second solution with a little bit of tweaking it seems to be working the way I want!!
Thanks for your help!
regards
Suthish NairPosted Oct 24, 2010, 2:52 AM