In code behind, how do I read a SqlDataSource list of values to use a for/next loop (as designated as "TargetList" in the snippet below)? I may not have the right DIM for the TargetList. Right now, I receive an error saying that the TargetList.DataSource = PromoList part is not a member of the System.Collection.ArrayLis
Dim TargetList As ArrayList
Dim i As Integer
Dim PromoList As SqlDataSource
PromoList.ConnectionString = "<%$ ConnectionStrings:SiteSqlServer%>"
PromoList.SelectCommandType = SqlDataSourceCommandType.StoredProcedure
PromoList.SelectCommand = "GetPromoList"
TargetList.DataSource = PromoList
TargetList.DataValueField = "PromoID"
For i = 0 To TargetList.Items.Count - 1
If TargetList.Items(i).Selected Then
cmd.Parameters("@ProdID").Value = Convert.ToInt16(TargetList.Items(i).Value)