怎样可以在DataGridView中获取选种的行的数据?

来源:百度知道 编辑:UC知道 时间:2024/05/20 06:05:26

参考呀,这是我程序中的一部分:
Dim dr As ds.dt缺勤Row
Dim i As Long = CType(Me.DataView1.Item(Me.DataGridView1.CurrentCell.RowIndex).Item("ID"), Long)
dr = Me.dataTable缺勤.FindByID(i)

"ID"是"dataTable缺勤"这个表的主键.