Dim filter7 As String = "会计科目编码 = '" & e.DataRow("会计科目编码") & "'and 账面会计科目编码 = '" & e.DataRow("账面会计科目编码") & "'and 日期 >= '" & e.DataRow("开始日期") & "'and 日期 <= '" & e.DataRow("截止日期") & "'and 公司名称 = '" & e.DataRow("公司名称") & "'"
Dim st As Date = Date.Now '将开始时间保存在变量st中
Sel ect Case e.DataCol.name
Case "会计科目编码"
msgbox(1)
If e.DataRow.Isnull("会计科目编码") = False Then
msgbox(2)
e.DataRow("科目编号") = e.DataRow("会计科目编码").SubString(0,e.DataRow("会计科目编码").IndexOf("_"))
msgbox(3)
Dim bh() As String = (e.DataRow("会计科目编码").SubString(e.DataRow("会计科目编码").IndexOf("_")+1,e.DataRow("会计科目编码").Length - e.DataRow("会计科目编码").IndexOf("_")-1)).split(".")
e.DataRow("项目编号") = bh(0)
'msgbox(e.DataRow("科目编号") )
'msgbox(e.DataRow("项目编号"))
Else
'e.DataRow("科目编号") = Nothing
'e.DataRow("项目编号") = Nothing
End If
msgbox(4)
End Select
msgbox(5)
MessageBox.Show("耗时: " & (Date.Now - st).TotalSeconds & "秒") '计算并显示执行代码所花费的秒数
msgbox(6)
执行上述代码 ,实际执行结果为:1-2-5-t-6-3-5-t-6-4-5-t-6,为什么不是1-2-3-4-5-t-6,这是什么原因?