Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Student Name    Class        Grno         Feemonth        Status
ABC              4th         123           
DEF              4th         456 
XYZ              4th         789


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
Posted
Updated 9-Mar-13 11:04am
v2
Comments
Muhammad Anis 0300 9-Mar-13 2:23am    
Help Me PLease
Maciej Los 9-Mar-13 17:06pm    
WinForms? WPF? ASP?
[no name] 9-Mar-13 17:09pm    
Help with what? How to write a for loop? How to compare values? How to use a button? Where is the code that you have tried?
Nelek 9-Mar-13 19:46pm    
agnesn88 13-Mar-13 2:45am    
how about vb.net??? :)

1 solution

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
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900