insert into test( id ,employdate ) values(1,"2002/03/09")

解决方案 »

  1.   

    错了应该是单引号
    insert into test( id ,employdate ) values(1,'2002/03/09')
      

  2.   

    insert into test(id ,employdate) values(1,'2002-03-09')
      

  3.   

    我 的 数据库 后台是sqlservere 是Pocket Pc上的,不知道也符合上面的规律吗
      

  4.   


    我这样写,有错误: insert into test( id ,employdate )//其中employdate是datetime类型       values(1,"2002-03-09")
    请教高手帮忙更正一下,我上面也用的单引号,还是出错的'2002-09-09'
      

  5.   

    string sql = "insert into test( id ,employdate ) values(@id,@employdate)";
    string conStr = 连接字符串
    SqlCommand command = new SqlCommand( sql,new SqlConnection( conStr ) );
    command.Parameters.Add( new SqlParameter("@id",SqlDbType.Integer);
    command.Parameters.Add( new SqlParameter("@employdate",SqlDbType.DateTime" );
    command.Parameters["@id"].Value = 1;
    command.Parameters["@employdate"].Value = DateTime.Parse("2002-03-09");
    command.Connection.Open();
    command.ExcuteNonQuery();
      

  6.   

    你要
    string sdate="2002-09-09";sql="insert into test( id ,'"+sdate+"' )";
      

  7.   

    试一下用dragontt(龙人)的方法。
    用单引号把日期括起来是没问题的,你的问题是否出在其他地方而跟这个日期无关呢?把错误提示粘出来看看。
      

  8.   

    xie xie da jia  wo  ma shang gei fen