I have a list box where the user can add choices depending on what items they want active in the database but I cannot figure out how loop through this listbox to update the items.
Any ideas?
Visual Studio 2010
Dim lstitem As String
For i = 1 To ListBox1.Items.Count()
lstitem = ListBox1.SelectedItem
sql = "UPDATE laitemtype SET IsActive = 1 where itemtypedescription=@lst"
Dim cmd6 As New SqlCommand(sql, Con)
cmd6.Parameters.Add("@lst", SqlDbType.VarChar, 144)
cmd6.Parameters("@lst").Value = lstitem
cmd6.ExecuteNonQuery()
Next i