Two alternatives:

1. Construct a Dataset that contains the sum contents of all other
datasets. Bind your control to this dataset.

2. Instead of Databinding, manually fill the list by iterating through
each dataset.

On Aug 5, 1:53 pm, Alfaking <[email protected]> wrote:
> Hi everybody,
> here is my question.
>
> I have to fill a listbox with a dataset, that comes from a sql
> statement
> this is part of a loop, in case of multiple selection coming from
> another listbox.
>
> the point is that when I use the DATABIND instruction, the listbox is
> updated with only the last dataset, loosing all the  existing rows.
> I need to do that databind because I need to keep the datavalue, for
> following selections...
> All I need is to keep on the screen all the datasets: is there any
> APPEND or any useful instruction ?
>
> here is part of the code----------
> loop in the first listbox
>
> For i = 0 To firstListbox.Items.Count - 1
> If firstListbox.Items(i).Selected Then
>   ZonaSel = firstListbox.Items(i).Value
>   CaricaVie(ZonaSel, GiroSel)
> End If
>
> after the dataset is filled.
>
>           Listbox.DataSource = DS2.Tables("Dati")
>           Listbox.DataTextField = "Column1_name"
>           Listbox.DataValueField = "Column_name"
>           Listbox.DataBind() <<------ here !!!
>
> Thanks

Reply via email to