Forum

VB'de Datagridview'...
 
Bildirimler
Hepsini Temizle

VB'de Datagridview'i değişkene aktarmak

4 Yazılar
2 Üyeler
0 Likes
664 Görüntüleme
(@MuratAjder)
Gönderiler: 36
Trusted Member
Konu başlatıcı
 

Kolay gelsin;

Visual Basic'de 2 adet datagridviewim var bunlar arasında kıyas yaptırmak istiyorum. Çok fazla satır olduğundan değişkene aktararak tablo kıyaslama komutuyla bunu yapmayı düşündüm ama bir türlü başarılı olamadım tüm forumlarda c# var vb'de bir türlü yardım bulamadım. Ne değişkene atabildim nede kıyas yapabildim, yardımcı olabilirseniz çok sevinirim.

 
Gönderildi : 23/02/2017 18:05

(@eravse)
Gönderiler: 1753
Üye
 

Merhaba , for each kullanarak ıkı data grıdın cell bazında kontrolunu yapabılırsınız ornek ;

 

'create a boolean to determine if found
        
        Dim isFound As Boolean = False
        'Start iterating through datagridview1
        For Each dgv1Row As DataGridViewRow In DataGridView1.Rows
            'and for each iteration through datagridview1 iterate through all of datagrid2
            
            For Each dgv2Row As DataGridViewRow In DataGridView2.Rows
                'compare each iteration of dgv1 with each iteration of dgv2
                If dgv1Row.Cells(0).Value = dgv2Row.Cells(0).Value Then
                    'if there is a match, we don't want to add it so set Found
                    isFound = True
                End If
            Next
            'only add to datagridview3 if isFound = false (meaning there was no
            'match from the current row in dgv1 to any of the rows in dgv2)
            'and reset isFound back to False
            If Not isFound Then
                DataGridView3.Rows.Add(dgv1Row.Cells(0).Value)
            End If
            isFound = False
        Next
        'Of course you would have to repeat this in reverse to compare dgv2 against dgv1
        'the same way to add an

orjinal post : http://forum.codecall.net/topic/74540-compare-datagridview/

saygılarımla

ProfectSoft Yazılım ve Danışmanlık Hizmetleri
LogPusher & Bifyou E-Commerce System
www.profectsoft.com

 
Gönderildi : 24/02/2017 02:55

(@MuratAjder)
Gönderiler: 36
Trusted Member
Konu başlatıcı
 

Çok teşekkür ederim tam istediğim şey süpersiniz!

 
Gönderildi : 24/02/2017 18:20

(@eravse)
Gönderiler: 1753
Üye
 

rica ederiz faydalı olması dileği ile

ProfectSoft Yazılım ve Danışmanlık Hizmetleri
LogPusher & Bifyou E-Commerce System
www.profectsoft.com

 
Gönderildi : 26/02/2017 02:18

Paylaş: