问题
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