0

我正在连接两个不同的 Web 服务,它们产生相同的数据结构。下面的示例代码将为我提供总计结果。

例子:

ItemSKU1  ItemName1  TotalQuantity1
ItemSKU2  ItemName2  TotalQuantity2
...

我希望能够将 Web 服务的结果分离为以下内容:

ItemSKU1  ItemName1  QuantityIP1  QuantityIP2
...

示例代码:

Dim returnds As New DataSet
Dim myreport As New RE.RE
Dim tmpURL = {"IP1", "IP2"}
Dim i As Integer
    For i = 0 To 1


        Try

            myreport.Url = "http://" & tmpURL(i) & "/RE.asmx"
            returnds = myreport.GetDeptDetails(date1, date2, dept)
            Me.gvReorder.DataSource = returnds
            Me.gvReorder.DataBind()
            returnds.Clear()
        Catch ex As Exception
            label.visible = true
            label.text = "Error: " & ex.Message
        End Try

    Next

当 IP1 结果是 SKU 和 IP2 结果 SKU 而不尝试合并多个数据集时,我该怎么做?

4

1 回答 1

0

我可以通过编辑数据表来做到这一点:

Dim tmpEditRow As DataRow = tmpReturnRows(0)

                    tmpEditRow.BeginEdit()

                    Select Case a

                        Case 0

                            tmpEditRow("Qsold / QoH1") = QtySold & " / " & QtyOH

                        Case 1

                            tmpEditRow("Qsold / QoH3") = QtySold & " / " & QtyOH

                        Case 2

                            tmpEditRow("Qsold / QoH4") = QtySold & " / " & QtyOH

                        Case 3

                            tmpEditRow("Qsold / QoH7") = QtySold & " / " & QtyOH

                        Case 4

                            tmpEditRow("Qsold / QoH8") = QtySold & " / " & QtyOH

                        Case 5

                            tmpEditRow("Qsold / QoH10") = QtySold & " / " & QtyOH

                        Case 6

                            tmpEditRow("Qsold / QoH12") = QtySold & " / " & QtyOH

                        Case 7

                            tmpEditRow("Qsold / QoH14") = QtySold & " / " & QtyOH

                    End Select

                    tmpEditRow.EndEdit()
于 2012-12-28T16:12:25.993 回答