执行insert 语句,怎样插入时间呢?
insert into table values(DataTime.Now .....
还是
insert into table values( 'DataTime.Now.Tostring() '.......
------解决方案--------------------INSERT INTO tab(theDate) VALUES(GETDATE())
------解决方案--------------------如楼上所说;使用系统函数getDate()获取当前时间
------解决方案--------------------LS正解
------解决方案--------------------INSERT INTO tab(theDate) VALUES(GETDATE())
------解决方案--------------------若只是在数据库中:insert into table (时间字段)values(getdate())
若在c#中连接字符串: "insert into table (时间字段)values( ' "+DataTime.Now + " ') "
------解决方案--------------------若只是在数据库中:insert into table (时间字段)values(getdate())
若在c#中连接字符串: "insert into table (时间字段)values( ' "+DataTime.Now + " ') "
------解决方案--------------------若只是在数据库中:insert into table (时间字段)values(getdate())
若在c#中连接字符串: "insert into table (时间字段)values( ' "+DataTime.Now + " ') "
------解决方案--------------------INSERT INTO table (date,xxx,xxxx)VALUES (GETDATE(), ' "+XX+ " ', ' "+XX+ " ')
------解决方案--------------------insert into table (时间字段)values(getdate())
------解决方案--------------------string strSQL = "insert into table (youcol) values (getdate()) ";
or
string strSQL = "insert into table (yaocol) values ( ' "+ DateTime.Now.ToString()+ " ') ";