比较2个Datagridview行 [英] Compare 2 Datagridview row's
本文介绍了比较2个Datagridview行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨
我在编写用于比较2 Datagridview数据的代码时遇到一些问题
Datagridview 1
Hi
I Have some Problems to write a code for comparing data of 2 Datagridview
Datagridview 1
Student Name Class Feemonth Amount
ABC 4th March 1500
XYZ 4th March 1500
Datagridview 2
Datagridview 2
Student Name Class Grno Feemonth Status
ABC 4th 123
DEF 4th 456
XYZ 4th 789
我想检查每一行来自Datagridview 1中的Datagridview 1基于学生名称来更新Feemonth&状态
请建议我使用按钮控件编写此事件的代码
I Want to Check Each Row from Datagridview 1 in Datagridview 2 Base on student Name to update Feemonth & status
Please Suggest Me to Write a code for this event using Button Control
推荐答案
您需要比较datagridview单元格值
如果DGV1.Rows(行索引)。单元格(单元格数)。值= DGV2.Rows(行索引)。细胞(细胞数)。价值然后
''这样做
否则
''做那个
结束如果
You need to compare the datagridview cell values
if DGV1.Rows("row index").Cells("# of cell").Value = DGV2.Rows("row index").Cells("# of cell").Value Then
''do this
Else
''do that
End If
这篇关于比较2个Datagridview行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文