I am a bit lost. Well, at first sight I noticed you are trying to display a HashSet within Listview items. I am not sure is this even possible. But we have a bigger problem...
I started to comment in/out parts of the code, until I found the line that causes the exception. It is the foreach loop. Code below does not work, but disabling foreach does the trick.Code:HashSet<usergroup> group = new HashSet<usergroup>(); ///... group.Add(users); Listview1.Items.Add(group);
Code:foreach (var peeps in queryResults) { //usergroup users = new usergroup(peeps.FirstN, peeps.LastN, peeps.JobT); ////users.firstname = peeps.FirstN; ////users.lastname = peeps.LastN; ////users.jobtitle = peeps.JobT; //group.Add(users); //Listview1.Items.Add(group); //Listview1.Items.Add(peeps.FirstN.ToString()); ////lv.Text = peeps.FirstN; ////lv.SubItems.Add(peeps.LastN); ////lv.SubItems.Add(peeps.JobT); ////listView1.Items.Add(lv); }


LinkBack URL
About LinkBacks





Reply With Quote


