0

我正在使用两个名为 dnddatatable 和 dtdup 的数据表。它包含一组电话号码。我想将第二个数据表与第一个数据表进行比较,并从数据表 1(名称为 dnddatatable)值中删除等于第二个数据表名称为(dtdup)的值。

data in the datatable as follows.

dnddatatable(data table1)

phone
9865015695
9840903331 
98668625
800971868
809679532
837445478

dtdup(dtata table2)

phone_numbers
9865015695
9840903331 

result dnddatatable(data table1)

98668625
800971868
809679532
837445478 
4

1 回答 1

1

我之前回答了一个非常相似的问题,想法完全一样

For i As Integer = 0 To dataset.Tables(0).Rows.Count - 1
        Dim found As Boolean = False
        For j As Integer = 0 To dataset1.Tables(0).Rows.Count - 1
            If dataset.Tables(0).Rows(i)(0).ToString = dataset1.Tables(0).Rows(j)    (0).ToString Then
                found = True
            End If
        Next
        If found = False Then
            'here you are getting the right result in each loop
            'in this example i'm showing the result in a textbox
            'just change the instruction and write them in your note pad or wherever you want to
            MsgBox(dataset.Tables(0).Rows(i)(0).ToString)
        End If
    Next
于 2012-12-13T21:33:33.657 回答