Rss & SiteMap
Foxtable(狐表) http://www.foxtable.com
'''
Dim T1,T2 As String
T1 = "DP" & Format(Date.today,"yyMM")
T2 = "[调坯单号] like '" & T1 & "*'and "
T2 = T2 & "[ID] < " & e.DataRow("ID")
Dim dr As DataRow = e.DataTable.Find(T2,"ID DESC")
e.DataRow("调坯日期") = Date.today
If dr is Nothing then
e.DataRow("调坯单号") = T1 & "001"
Else
Dim n As Integer = Cint(Right(dr("调坯单号"),3))+1
e.DataRow("调坯单号") = T1 & Format(n,"000")
End If
把这段代码放到DataRowAdded里面试试
触发DataRowAdding事件时,ID列还是空值,没办法引用
还不行发文件
还是出现同样的错误!