![Avatar of r3nder](https://filedb.experts-exchange.com/files/public/2013/11/18/7e490717-1f0b-40c1-b184-4b21f75d30b5.png)
checvk box list and for each loop
I have a check box list I want to loop through the list and get the value of each item selected and insert each item into the database individualy does any one know how to do this
Thanks
Protected Sub ddlFIlterType_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ddlFIlterType.SelectedIndexChanged
If (ddlFIlterType.SelectedItem.ToString = "Department") Then
getDepartment()
'Response.Write("I got it to click")
ElseIf (ddlFIlterType.SelectedItem.ToString = "City Office") Then
getCity()
ElseIf (ddlFIlterType.SelectedItem.ToString = "Job") Then
getJob()
ElseIf (ddlFIlterType.SelectedItem.ToString = "Region") Then
getRegion()
End If
End Sub
And this is my fill for the cblValues Public Sub getDepartment()
Try
Dim ds As DataSet = Nothing
ds = SqlHelper.ExecuteDataset(appSecurity.getConnection(), CommandType.StoredProcedure, "SP")
Me.cblValues.DataSource = ds.Tables(0)
Me.cblValues.DataTextField = "dept_nm"
Me.cblValues.DataValueField = "deptid"
Me.cblValues.DataBind()
Catch ex As Exception
Response.Write(ex.Message)
End Try
End Sub
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER