My DateTime.Now function returns #. Is something wrong with my visual studio or something wrong in the declaration

て烟熏妆下的殇ゞ 提交于 2019-12-13 08:46:02

问题


Is something wrong with my visual studio or am i missing something. When ever i convert something into datetime these # add up. And i cannot send strings to the database to get data


回答1:


This is just VB's visual representation of DateTime literal. Never mind it, it's has a DateTime value - use it as such.




回答2:


If you're sending strings to a database, my guess is you're not using parameters. Try using a parameter and assigning the datetime to it.




回答3:


If you need it without the VB.NET date/time delimiters (the # symbols), just append the ToString method.

? Date.Now
#11/7/2014 5:42:40 PM#
? Date.Now.ToString
"11/7/2014 5:42:46 PM"


来源:https://stackoverflow.com/questions/26811294/my-datetime-now-function-returns-is-something-wrong-with-my-visual-studio-or

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!