在datarowadding事件中加入如下代码后,再这个表中新增行后为什么代码有时执行,有时不执行?
'生成临时编号 Dim cmd As New SQLCommand Dim dt As Date cmd.C cmd.CommandText = "Select GetDate()" dt = cmd.ExecuteScalar() dt = dt.DateStatic Index As Integer = 99999e.DataRow("ksmc_id") = Format(dt,"yyMM") & "-" & IndexIndex = Index - 1