Hi ,
I m using VS2008 with SQL server 2008 at the backend. I m creating a windows application in which I have 2 listboxes.the data is being retrieved from SQL server database in listbox1.i want to select few itms from this listbox and add them to second one through add button. PROBLEM: the values are being retireved from database but when i click add button after selecting a value from listbox1, System.Data.DataRowView is displayed in listbox2 automatically. listbox2 is not currently connected to any databse. here is the code
for (int i = 0; i < listBox1.Items.Count; i++)
{ listBox2.Items.Add(listBox1.Items[i]);
listBox1.Items.Remove(listBox1.SelectedItem);
}
i have also tried using this:
for (int i = 0; i < from.SelectedItems.Count; i++)
{ to.Items.Add(from.SelectedItems[i].ToString()); }
foreach (var item in new ArrayList(from.SelectedItems))
{ from.Items.Remove(item); }
from and to are listbox1 and listbox2 respectively
any help will be appreciated