Try
Select Case _OperationType
Case OperationTypeEnum.add
For Each R As Row In e.Form.Controls("Table1").Table.Rows
If r.DataRow.RowState=DataRowState.Added
r.Save
End If
Next
e.Form.Controls("txtzt").text="当前状态:查阅"
Case OperationTypeEnum.edit
For Each R As Row In e.Form.Controls("Table1").Table.Rows
If r.DataRow.RowState=DataRowState.Modified
r.Save
End If
Next
e.Form.Controls("txtzt").text="当前状态:查阅"
End Select
e.Sender.Enabled =False
Catch ex As Exception
MessageBox.Show(ex.tostring,"向服务器提交数据错误!",MessageBoxButtons.OK)
End Try
应该在r.Save这句就出错了,可为什么 e.Sender.Enabled =False会被执行了呢