且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

DateTime.Now成SMALLDATETIME?

更新时间:2023-01-28 09:48:08

我会建议使用的参数。 cmd.Parameters.AddWithValue(@日,与Date.toString); AddWithField 将采取适当的照顾转换。

I would suggest using parameters. cmd.Parameters.AddWithValue("@date", date.toString); The AddWithField will take care of the proper conversion.

您InsertSQL说明书就变成了:

Your InsertSQL statment becomes:

sql = "INSERT INTO YTOODLE_LINKS (YTOODLE_LINKS.TASK_ID,YTOODLE_LINKS.LINK_TITLE,YTOODLE_LINKS.LINK_DESC,YTOODLE_LINKS.LINK_PATH,YTOODLE_LINKS.USER_ID,YTOODLE_LINKS.LAST_USER_EDIT)VALUES (1,'','','',2,'1',@date)";