应该是。
strInsert += dtpdate.Text + "')" ;
改为
strInsert += dtpdate.Value.ToShortDateString()+ "')" ;
试一下。

解决方案 »

  1.   

    帅哥我按照你写的改了下,还把datetimepicker的FORMAT属性改为了short还是不行,请各位大侠再帮我看看,紧!
      

  2.   

    VALUES ( '" ;
    strInsert += tbxname.Text + "', #" ;
    strInsert += tbxtelphone.Text + "#)" ;
      

  3.   

    你需要设置日期的格式,插入和修改的时候最好用参数来传递,例如:
    string strInsert = " INSERT INTO tel ( name , telphone , date ) VALUES ( '" ;
    strInsert += tbxname.Text + "', " ;
    strInsert += tbxtelphone.Text + ", " ;
    "@myDate)" ;
    OleDbCommand inst = new OleDbCommand ( strInsert , myConn ) ;
    inst.Parameters.Add("@myDate",dtpdate);
    inst.ExecuteNonQuery ( ) ;
    myConn.Close ( ) ;
      

  4.   

    Sorry,

    string strInsert = " INSERT INTO tel ( name , telphone , date ) VALUES ( '" ;
    strInsert += tbxname.Text + "', " ;
    strInsert += tbxtelphone.Text + ", " ;
    "@myDate)" ;
    改为
    string strInsert = " INSERT INTO tel ( name , telphone , date ) VALUES ( '" 
         + tbxname.Text + "', " 
         + tbxtelphone.Text + ", " 
         + "@myDate)" ;
      

  5.   

    Sorry,

    string strInsert = " INSERT INTO tel ( name , telphone , date ) VALUES ( '" ;
    strInsert += tbxname.Text + "', " ;
    strInsert += tbxtelphone.Text + ", " ;
    "@myDate)" ;
    改为
    string strInsert = " INSERT INTO tel ( name , telphone , date ) VALUES ( '" 
         + tbxname.Text + "', " 
         + tbxtelphone.Text + ", " 
         + "@myDate)" ;