hd181a
asked on
Clearing a dataset before looping
The following code is inside a loop and gets executed several times
strSql2 = "SELECT * FROM Field_Select_Values WHERE field_id = " & Row("field_id")
da2 = New SqlDataAdapter(strSql2, conn)
da2.Fill(ds, "Field_Select_Values")
'set the size of the list to be the number of rows
lstField.Rows = ds.Tables("Field_Select_Va lues").Row s.Count
For Each Row2 In ds.Tables("Field_Select_Va lues").Row s
lstField.Items.Add(Row2("f ield_selec t_value"))
Next
The data for the outter loop is contained in ds as well. How can I clear the data from ds.Tables("Field_Select_Va lues")?
strSql2 = "SELECT * FROM Field_Select_Values WHERE field_id = " & Row("field_id")
da2 = New SqlDataAdapter(strSql2, conn)
da2.Fill(ds, "Field_Select_Values")
'set the size of the list to be the number of rows
lstField.Rows = ds.Tables("Field_Select_Va
For Each Row2 In ds.Tables("Field_Select_Va
lstField.Items.Add(Row2("f
Next
The data for the outter loop is contained in ds as well. How can I clear the data from ds.Tables("Field_Select_Va
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ds.Tables("Field_Select_Va lues").Cle ar()