Thanks & Regards, Santhi .V
protected void Button1_Click(object sender, EventArgs e) { String str = ""; for (int i = 0; i <=CheckBoxList1.Items.Count-1; i++) { if (CheckBoxList1.Items[i].Selected) { if (str == "") { str = CheckBoxList1.Items[i].Text; } else { str += "," + CheckBoxList1.Items[i].Text; } } } con.Open(); SqlCommand cmd = new SqlCommand("insert into tablename values('" +str + "')", con); cmd.ExecuteNonQuery(); }
Login to post response