Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
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 Los171.2K
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 :)

1 solution

Rate this: bad
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
'do that
End If

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

  Print Answers RSS
0 OriginalGriff 605
1 Maciej Los 225
2 Abhinav S 171
3 Richard Deeming 160
4 Suvendu Shekhar Giri 159
0 Sergey Alexandrovich Kryukov 9,623
1 OriginalGriff 9,095
2 Peter Leow 5,044
3 Kornfeld Eliyahu Peter 3,373
4 Maciej Los 2,581

Advertise | Privacy | Mobile
Web04 | 2.8.150327.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