我宣布我的日期是在我的代码如下:申报时间 - “从类型转换“时间跨度为键入‘整’无效”
Dim DeliveryDate as Date
但现在我想然而申报时间我不断收到错误,因为我无法获得正确的类型。我尝试了以下,但得到以下错误:“从'时间跨度'类型'整数'转换是无效的”。
Dim DeliveryTime as DateTime
Dim DeliveryTime as Integer
我的数据库中交货期类型设置为时间(7),所以我会假设应该有“时间”,我可以用它来声明它,但心不是。什么是我应该使用的正确类型?
这是我的确切代码。有错误是Input string was not in correct format
:
GraphDate4 = String.Empty
DeliveryProducts = "{ name: 'DeliveryProducts', data: ["
If DataReader4.HasRows Then
While DataReader4.Read
Dim DevTime As Timespan = DataReader4("DeliveryTime")
GraphDate4 += """" + DevilTime.ToString("d") + ""","
DeliveryProducts += DataReader4("DeliveryProducts").ToString() + ","
End While
End If
是不是'TimeSpan'合适?这就是编译器所建议的。 – jv42 2012-02-23 09:31:36
@ jv42我试过Timespan,但由于发生以下错误而无法生成:“输入字符串的格式不正确。” – Blob 2012-02-25 09:45:40
然后,你需要解析字符串... – jv42 2012-02-25 11:05:27