If you want to insert the selected data in single column, you can use following code for storing the data into database. It will be inserting values with comma as a separator.
string selectedItems = string.Empty;
foreach (ListItem item in this.CheckBoxList1.Items)
{
if (item.Selected)
selectedItems += item + ",";
}
SqlCommand cmd = new SqlCommand("Insert into YOUR_TABLE(YOUR_COLUMN) values('" + selectedItems + "')", cn);
cn.Open();
int iCount = cmd.ExecuteNonQuery();
cn.Close();
For selecting:
void LoadCheckList()
{
string selectedItems = "";
SqlCommand cmd = new SqlCommand("Select YOUR_COLUMN from YOUR_TABLE", cn);
SqlDataReader dr;
cn.Open();
dr = cmd.ExecuteReader();
if (dr.Read())
{
selectedItems = dr["selectedItems"].ToString();
}
dr.Close();
cn.Close();
string[] arr = selectedItems.Split(',');
foreach (ListItem item in this.CheckBoxList1.Items)
{
foreach (string s in arr)
{
if (item.Text== s)
{
item.Selected = true;
}
}
}
}