I use the following code:
sqlCon.ConnectionString = "Data Source=localhost;Database=VivekDB;Integrated Security=true"
sqlCom.CommandText = "select pname, pcode from components where designid = '" & designID & "' and pcode like 'BT%' order by pname"
sqlCom.Connection = sqlCon
da.SelectCommand = sqlCom
sqlCon.Open()
da.Fill(ds, "Bottom Tracks")
sqlCon.Close()
sqlCon.Dispose()
sqlCom.Dispose()
dt = ds.Tables("Bottom Tracks")
bindList(ltbBot, dt, "pname", "pcode")
As you can see I m providing a listbox to the user to select some deisgn type, and then accordingly the various data is loaded into the other listbox, which is being binded to the datatable using the bindlist sub (last line)
Now the problem is: My form has a back button, So that the user can modify his designs... Now when the above code gets re executed, the new data that is retrived gets appended to the previously fetched data...
How can I get rid of this problem?
Please help

Add Reply





MultiQuote
| 


