in my page checkboxlist is there .i want to select multiple checkboxes in checkboxlist.after selecting i want to click button.so i want code for store these selected checkbox values into sql server backend table..(code in c#)....in button click
Checkboxlist
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Niradhip ChakrabortyRank #429 · 5.8K reputationPosted Dec 3, 2008, 7:04 AM EST
Say your check box name chkDemo
string strsql = "";
foreach (object obj in chkDemo.CheckedItems)
{
if (strsql.Trim() == "")
{
strsql = "'" + obj.ToString() + "'";
}
else
{
strsql += ",'" + obj.ToString() + "'";
}
}
now whatever you checked in checkbox, I am storing in strsql with comma separator. Now you can store the string in your database. While retrieving from database you can split the string with comma separator and store it in array to use.