我不是很懂的这个是代码:  Connection connection = new Connection();
                string sql = "insert into 会员档案(hybh,hyxm,hyxb,zjmc,zjhm,lxdh ,yddh,jtzz,yzbm,dzxx,bzrq,dqrq,hyjb,yccz,xfcz,zsjf,xfjf,yxcs,xfcs,bcsm) values ( '"
                    + textBox1.Text + "','" + textBox2.Text + "','" + comboBox1.Text + "','" + textBox3.Text + "','"
                    + textBox4.Text + "','" + textBox5.Text + "','" + textBox6.Text + "','" + textBox7.Text + "','"
                    + textBox8.Text + "','" + textBox9.Text + "','" + Convert.ToDateTime(dateTimePicker1.Value) + "','" +Convert.ToDateTime( dateTimePicker2.Value)+ "','"                    + comboBox2.Text + "','" + textBox10.Text + "','" + textBox11.Text + "','" + textBox12.Text + "','"
                    + textBox13.Text + "','" + textBox14.Text + "','" + textBox15.Text + "','" + textBox16.Text + "')";
                connection.inserts(sql);

解决方案 »

  1.   

    Connection connection = new Connection();
      string sql = "insert into 会员档案(hybh,hyxm,hyxb,zjmc,zjhm,lxdh ,yddh,jtzz,yzbm,dzxx,bzrq,dqrq,hyjb,yccz,xfcz,zsjf,xfjf,yxcs,xfcs,bcsm) values ( '"
      + textBox1.Text + "','" + textBox2.Text + "','" + comboBox1.Text + "','" + textBox3.Text + "','"
      + textBox4.Text + "','" + textBox5.Text + "','" + textBox6.Text + "','" + textBox7.Text + "','"
      + textBox8.Text + "','" + textBox9.Text + "','" + Convert.ToDateTime(dateTimePicker1.Value) + "','" +Convert.ToDateTime( dateTimePicker2.Value)+ "','" + comboBox2.Text + "','" + textBox10.Text + "','" + textBox11.Text + "','" + textBox12.Text + "','"
      + textBox13.Text + "','" + textBox14.Text + "','" + textBox15.Text + "','" + textBox16.Text + "')";
    Response.Write(sql);//输出结果值,你的表中有时数值型的,但是你用字符串了,不能互转
     // connection.inserts(sql);
      

  2.   

    那你那个字段是mumeric的,
    你合成的时候是将非数字的字符合成上去了.就会造成这个问题.
      

  3.   

    你这是将DATTIME类型插入进mumeric类型里,肯定不行啊
      

  4.   

    那我应该怎么修改?在数据库的表里用的是varchar类型的。???
      

  5.   

    insert into里如你的数据表里字段是数值类型,就不用' '号了。‘ ’是string型