hi,
I have modified your and get the CheckBox here, if this checkbox is checked then it will save the values
protected void parent_ItemCommand1(object source, RepeaterCommandEventArgs e)
{
Label lblserv = new Label();
lblserv = (Label)e.Item.FindControl("lbl");
string txt = lblserv.Text;
CheckBox chkServ = new CheckBox();
chkServ = (CheckBox)e.Item.FindControl("services1");
if (e.CommandName == "insert") ;
{
if (chkServ.Checked)
{
SqlConnection con = new SqlConnection("Data Source=USER-PC\\SQLEXPRESS;Initial Catalog=MEDICALVOYAGER;Integrated Security=True");
con.Open();
SqlCommand cmd = new SqlCommand("insert into SERVICES_SELECTED(SERVICESNAME) values(@serv)", con);
cmd.Parameters.AddWithValue("@serv", txt);
cmd.ExecuteNonQuery();
Response.Write("inserted");
con.Close();
}
}
}
you should do same as for the child.