Even though your question is bit vague, but as per my understanding problem is as below and this is the reason why its not entering the
for loop
I think you are trying to move item from the
lst_leftstar
to
lst_rightstar
, and when at the start you will try to move an item from left to right, the right listbox will be empty i.e. item.count = 0. hence it will not enter for loop.
and I think you replace this
Quote:
for (int i = 0; i < lst_rightstar.Items.Count; i++)
with
for (int i = 0; i < lst_leftstar.Items.Count; i++)
I hope it will solve your problem of not entering in for loop.
Further inside the loop there is a mistake of column mismatch.
on the start you are adding a column named Star_Id
Quote:
dt.Columns.Add("Star_Id");
while inside the loop you are trying to enter value in
Quote:
dt.Rows[i]["Star_Name"]
i.e. Column Named as Star_Name which you have not added before..
Hope it will help you.. :)