checkBox1.Checked?"为真的值":"为假的值"

解决方案 »

  1.   

    chidao,zaotui,kuangke的字段类型是什么?
      

  2.   


      string sql = @"INSERT INTO xinxi (name,subject,chidao,zaotui,kuangke,date) VALUES
    ('" + textBox2.Text + "','" + textBox3.Text + "','" + checkBox1.Checked?"为真的值":"为假的值" + "','" + checkBox1.Checked?"为真的值":"为假的值"  + "','" + checkBox1.Checked?"为真的值":"为假的值" + "','" + textBox4.Text + "')";
      

  3.   

                        if (this.checkBox1.Checked == true)
                        {
                            item.SubItems.Add("是");
                        }
                        else 
                        {
                             item.SubItems.Add("否");
                        }
                         if (this.checkBox2.Checked == true)                    {
                            item.SubItems.Add("是");
                        }
                        else
                        {
                            item.SubItems.Add("否");
                        }
                       if (this.checkBox3.Checked == true)
                   
                           {
                               item.SubItems.Add("是");
                           }
                           else
                           {
                               item.SubItems.Add("否");
                           }提取的时候他怎么拿的是checked的默认值
    想让他取数据库的值
    该怎么改呢??
      

  4.   

    checkBox1.text 的值应该是int 型的 1 0 然后用下面的方法
    Convert.ToBoolean(checkBox1.text);