If e.DataTable.DataRows.Count = 0 Then '如果是一个空表 Return '那么返回 End
If Dim dr As DataRow = e.DataTable.DataRows(e.DataTable.DataRows.Count - 1) '获得最后一行 For Each dc As DataCol In e.DataTable.DataCols e.DataRow(dc.Name) = dr(dc.Name) '将最后一行的内容复制到新增行中. Next