有三个DataSet,要把三个DataSet重的数据信息读出来,放进一个DataTable或者DataSet里面去,怎么实现呢?
请大家赐教!小的感激不尽

解决方案 »

  1.   

    bu yao sikao de fangfa xunhuan
      

  2.   

    Private Function Com(ByVal ds1 As DataSet, ByVal ds2 As DataSet, ByVal ds3 As DataSet) As DataTable
            Dim i As Integer
            Dim j As Integer
            Dim havedata As Boolean
            Dim m As Integer        For i = ds1.Tables(0).Rows.Count To 0 Step -1
                havedata = False            For j = 0 To ds2.Tables(0).Rows.Count - 1                If ds1.Tables(0).Rows(i)(0).Equals(ds2.Tables(0).Rows(j)(0)) Then                    For m = 0 To ds3.Tables(0).Rows.Count - 1                        If ds1.Tables(0).Rows(i)(0).Equals(ds2.Tables(0).Rows(m)(0)) Then
                                havedata = True
                            End If
                        Next
                    End If
                Next            If havedata = False Then
                    ds1.Tables(0).Rows.RemoveAt(i)
                End If
            Next
            ds1.AcceptChanges()
            Return ds1.Tables(0)
        End Function
      

  3.   

    放 DataTable 的效率会很差的,最好不要用