且构网

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

如何在msaccess数据库中保存日期时间格式

更新时间:2022-10-25 08:41:02

保存MS Accessdatabase中的日期时间格式 [ ^ ]正如Richard在上面的评论中所建议的那样,你添加
 string.Format(#{0}#,DateTime.Now.ToString( dd-MMM-yyyy))

到你的sql插件的末尾


Database Design as follows

Field Name DataType
Entered Date DateTime

In database i want to save the Entered Date in Datbase.

Important Note:In Design Entered Date is not there and is also not required.


Automatically i want to save Entered Date in the database.


Regards,
Narasiman P.

See your own code at save the date time format in MS Accessdatabase[^] where as Richard has suggested in the comment above you add
string.Format ( "#{0}#", DateTime.Now.ToString ( "dd-MMM-yyyy" ) )

to the end of your sql insert