Updating sql database from a listbox

Upon initialization of my listbox the data will populate but after it will not change (hence refresh does not work). I could set the Data Source again but that feels sloppy. After looking into some of the documentation I noticed the event handler Data Source Changed which maybe more for what I am looking for. All it does is set up a table from the database and then returns the table.

Currently, the code does not return an error however when I put a breakpoint on the code where it pulls the selected values I still see the original selected values (the ones that are pulled from the database field) instead of newly selected values. Just to get to grips with it, I made the following demo, which seems to work fine. Get Selected Indices() Dim strresult As String = Nothing Dim strlen As Integer = Nothing For i As Integer = 0 To sel Idxs. Find Control("lbox_Construction Type") Dim sel Idxs As Integer() = listbox1. Command Text = "SELECT CONSTRUCTIONTYPEID FROM [Projects] WHERE [Project ID] = '" & project & "'" Try txtbox = sql. Find Control("lbox_Construction Type") 'Dim txtbox As Text Box = fv Projects. Close() End Try Dim listbox1 As List Box = fv Projects.

Leave a Reply