If e.DataCol.name = "要求交货日期" Then
If e.DataRow.isnull("要求交货日期") = False Then
If e.DataRow.isnull("序号") Then
Dim max As Integer = e.DataTable.SQLCompute("Max(序号)", "[_Identify] <> " & e.DataRow("_Identify")) '取得最大序号
e.DataRow("序号") = max + 1
'e.DataRow.save
DataTables("叫料piao号").save
End If
Else
e.DataRow("序号") = Nothing
'e.DataRow.save
DataTables("叫料piao号").save
End If
End If
上面的代码,无论用 e.DataRow.save 还是 DataTables("叫料piao号").save,都无法保存数据,因为我每次再增加一行时,e.DataRow("序号") 的数据不会增加 1。如果我先增加一行后,用人工保存一下数据库,再增加一行时,e.DataRow("序号") 的数据就会增加 1 了。请问是为什么呢?谢谢。