Dear @ukd,
please modify your submitquestion click event like below,
protected void Submitquestion_Click(object sender, EventArgs e)
{
string chkbox1Value="";
string chkbox2Value="";
string chkbox3Value="";
if(checkbox1.Checked)
{
chkbox1Value="True";
}
else
{
chkbox1Value="False";
}
if(checkbox2.Checked)
{
chkbox2Value="True";
}
else
{
chkbox2Value="False";
}
if(checkbox3.Checked)
{
chkbox3Value="True";
}
else
{
chkbox3Value="False";
}
string chkboxLevel=chkbox1Value+","+chkbox2Value+","+chkbox3Value;
obj.CreateConnectionsql();
string query = "insert into Question(Question , Answer, Chapter_name, Question_type_id,Level ) values('" + txtquestion.Text + "','" + txtanswer.Text + "','" + ddlchaptername.SelectedIndex + "','" + ddlquestionlevel.SelectedIndex + "','" + chkboxLevel + "')";
SqlCommand cmd = new SqlCommand(query, clsDataAccess.Conn);
cmd.ExecuteNonQuery();
txtquestion.Text = string.Empty;
txtanswer.Text = string.Empty;
checkbox1.Text = string.Empty;
checkbox2.Text = string.Empty;
checkbox3.Text = string.Empty;
obj.CloseConnection();
}