I have a listbox and am allowing the user to make multiple selections from it - the selected values are combined and concatenated via the below code and then insterted into a single SQL column.
Dim str3() As String
Dim strHardware As String
For i As Integer = 0 To lbServersHardwareAffected.Items.Count - 1
If lbServersHardwareAffected.Items(i).Selected = True Then
strHardware = strHardware + lbServersHardwareAffected.Items(i).Text
strHardware = strHardware + ", "
If Not strHardware = "" Then
strHardware = Left(strHardware, Len(strHardware) - 2)
str3 = strHardware.Split(CType(",", Char))
What I am trying to do is to grab the results from the SQl column (e.g. = value1, value2, value3) and setup a listbox in a datalist to pre-select the values. I am using a Dataset and a store rpocedure to select and return the data from the database. Need it in VB.NET if possible -