Can't make out anything wrong with the code you've presented. So, the
error might lie in your insert statement.

On Apr 23, 5:15 pm, Gourav <[email protected]> wrote:
> Hi All ,
> I have a checkBoxList with Approx  ( 20-30  ) [ Because its Dynamic ]
> ListItems.  When the user selects 2 or more items, and clicks submit,
> only the first item is inserted into my database.  What can I do to
> get all the checked values inserted into the db?  The CheckBoxList
> control is inserting into one db field, and there is plenty of room in
> the field for all values.I am really new to asp.net amd programming,
> how to do you loop through the items inside the CheckBoxList...
>
> I  tried to use foreach to get all selected items
>
> eg.
>
>         foreach(ListItem item in CheckBoxList1.Items)
>         {
>             if (item.Selected == true)
>             {
>                //  the insert command
>             }
>
>         }
>
> --
>
> Warm Regards:-
>   Gourav Vishnoi
>  +91-9871157845
>
> --
> Subscription 
> settings:http://groups.google.com/group/dotnetdevelopment/subscribe?hl=en

Reply via email to