Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
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 8-Mar-13 21:22pm
Edited 9-Mar-13 12:04pm
Maciej Los167.5K
v2
Comments
Member 8631057 at 9-Mar-13 2:23am
   
Help Me PLease
Maciej Los at 9-Mar-13 17:06pm
   
WinForms? WPF? ASP?
ThePhantomUpvoter at 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 at 9-Mar-13 19:46pm
   
agnesn88 at 13-Mar-13 2:45am
   
how about vb.net??? :)

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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
  Permalink  

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



Advertise | Privacy | Mobile
Web02 | 2.8.150301.1 | Last Updated 18 Mar 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100