I got 3 listViews 2 textbox and 2 buttons in WinForm.
Description of the program: the program adds numbers to listview by entering numbers in the textbox and pressing the button button
Purpose: I want to use the IEnumerable.Except method to output only unique numbers in listView3 , for example, in the figure below, unique numbers are 3 and 7 in listView1 and listView2 . ListViewItem lvi = new ListViewItem (textBox1.Text); listView1.Items.Add (LVI);
ListViewItem lv = new ListViewItem(textBox2.Text); listView2.Items.Add(lv); //im doing somthing wrong here... var nonintersect = listView1.Except(listView2).Union(listView2.Except(listView1)); //populate listview3 with the unique numbers... // foreach (item ) // { // }
Error message: System.Windows.Forms.ListView 'does not contain a definition for "Except" and does not use the extension method "Except" for accepting the first argument of the type "System.Windows.Forms.ListView" that can be found (you do not have a directive using or assembly reference?)

source share