Rss & SiteMap
Foxtable(狐表) http://www.foxtable.com
当月份大于9的时候是正常的,小于的时候应该是2013-07这样的,结果是2013-7-,帮忙看下,谢谢!
If e.DataCol.Name = "有效期" Then
Dim dt As DataRow = e.DataRow
If dt.IsNull("有效期") Then
dt("有效期至") = Nothing
Else
Dim t As String= dt("有效期")
t= mid(t,1,4) & "-" & Mid(t,6,2)
dt("有效期至") = t
End If
End If
谢谢思路,变通了下,不然要报错
If e.DataCol.Name = "有效期" Then
Dim dt As DataRow = e.DataRow
If dt.IsNull("有效期") Then
dt("有效期至") = Nothing
Else
Dim t As Date= dt("有效期")
dim t1 as string
t1= t.Year & "-" & t.Month
dt("有效期至") = t1
End If
End If
比原来的好些了,取出来是:2012-4
我还是格式成2012-04 这样的,该如何操作呢