TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
rohit manhas
NA
25
0
insert selected checkbox list data into database
Apr 20 2010 2:38 PM
this is my checkbox list......
<asp:CheckBoxList ID="CheckBoxList1" runat="server">
<asp:ListItem>Public Tap</asp:ListItem>
<asp:ListItem>Well Water</asp:ListItem>
<asp:ListItem>Hand Pump</asp:ListItem>
<asp:ListItem>Tap Water Within House</asp:ListItem>
</asp:CheckBoxList>
nw i want when i select any of the items ,may be all, from this checkbox list it will be stored into database....
one more thing each listitem had seperate column in database....
like...
publicTap | WellWater | HandPump | tap Water.....
i had written this code but it is not working ............
String str="";
for(i=0; i<CheckBoxList1.Items.Count; i++)
{
if(CheckBoxList1.Items[i].Selected)
{
str += CheckBoxList1.Items[i].Text;
}
}
cmd.Parameters.AddWithValue("@WSTapWater", str);
cmd.Parameters.AddWithValue("@WSWellWater", str);
cmd.Parameters.AddWithValue("@WSPublicTap", str);
cmd.Parameters.AddWithValue("@WSHandPump", str);
plz help me to go through this.......
Reply
Answers (
5
)
Tree traversal
find the proportional area of some squares confined betwnn a ring in C#