简体   繁体   English

在VB.net中的日期字符串+“-23.59.59.999”在VS2003中工作,而在VS2008或VS2010中工作

[英]In VB.net datestring + “-23.59.59.999” working in VS2003 not in VS2008 or VS2010

Hi All The Below code is working fine in Visual Studio 2003 but after i converted the solution to VS2008 the Below is giving error. 大家好,下面的代码在Visual Studio 2003中工作正常,但是在将解决方案转换为VS2008之后,下面给出了错误。 Please Help me to fix the issue 请帮助我解决问题

code: 码:

Dim strToDate As string
strToDate = "2013-02-06"

Dim dateFromSelect, dateToSelect, dateToSelectEnd, dateFromSelectStart As DateTime

dateToSelectEnd = strToDate + "-23:59:59.9999999"

Error 错误

Conversion from string "2013-02-06-23:59:59.9999999" to type 'Date' is not valid

the problem is 问题是

dateToSelectEnd = strToDate + "-23:59:59.9999999"

it should be 它应该是

dateToSelectEnd = strToDate + " 23:59:59.9999999"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM