string strCheckValue = ""; if (checkBox1.Checked) { strCheckValue = strCheckValue + "," + checkBox1.Text; } if (checkBox2.Checked) { strCheckValue = strCheckValue + "," + checkBox2.Text; } if (checkBox3.Checked) { strCheckValue = strCheckValue + "," + checkBox3.Text; } if (checkBox4.Checked) { strCheckValue = strCheckValue + "," + checkBox4.Text; } if (checkBox5.Checked) { strCheckValue = strCheckValue + "," + checkBox5.Text; } if (checkBox6.Checked) { strCheckValue = strCheckValue + "," + checkBox6.Text; } if (checkBox7.Checked) { strCheckValue = strCheckValue + "," + checkBox7.Text; } if (checkBox8.Checked) { strCheckValue = strCheckValue + "," + checkBox8.Text; } strCheckValue = strCheckValue.TrimStart(','); con.Open(); cmd.CommandText =("insert into Table1 values('"+strCheckValue+"')"); cmd.ExecuteNonQuery(); da.Update(ds, "Table1"); MessageBox.Show("Data Inserted "); con.Close();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)