上一篇 | 下一篇

在 ADO 和 ADO.NET 中管理离线数据

发布: 2008-6-26 22:34 | 作者: admin | 来源: | 查看: 1次

  

  清单 6. 标识更改的行并保存更改。

  

  Dim oDataRow As DataRow

  Dim oChangeDT As DataTable

  'Get DataTable with only changed rows

  oChangeDT = oEmployeeDT.GetChanges()

  'Save button s/b disabled until a change is made

  If oChangeDT Is Nothing Then

  Exit Sub

  End If

  'Loop thru changed rows, make db updates

  For Each oDataRow In oChangeDT.Rows

  Select Case oDataRow.RowState

  Case DataRowState.Added

  'Insert code here

  Case DataRowState.Modified

  'Update code here

  Case DataRowState.Deleted

  'Delete code here

字号: | 推荐给好友

33/3<123

评分:0

我来说两句