我是直接用数据库查询做的,希望对你有帮助
table1和table2都有field1字段
在ListBox1中
select * from table1 where table1.field1 not in (select field1 from table2)在ListBox2中
select * from table1 where table1.field1 in (select field1 from table2)
table1和table2都有field1字段
在ListBox1中
select * from table1 where table1.field1 not in (select field1 from table2)在ListBox2中
select * from table1 where table1.field1 in (select field1 from table2)
listbox2.Items.Add(listbox1.SelectedItem)
ListBox1.Items.RemoveAt(ListBox1.SelectedIndex)
数据从listbox2到listbox1
listbox1.Items.Add(listbox2.SelectedItem)
ListBox2.Items.RemoveAt(ListBox2.SelectedIndex)