下面的代码 dr.SetAdded() 语句给出了这样的错误:
“setadded 和 setmodified 只能在 datarowstate 不变的数据行上调用” 现在该怎么办?
dBindSet.AcceptChanges()
For Each dt As DataTable In dBindSet.Tables
BindingContext(dt).EndCurrentEdit()
For Each dr As DataRow In dt.Rows
dr.SetAdded()
dr.Item("CREATEDON") = strServerDate
dr.Item("CREATEDBY") = iUserID
Next
Next