Visual Basic.NET - Consumir las transacciones de un DataSet

 
Vista:
sin imagen de perfil

Consumir las transacciones de un DataSet

Publicado por Luis (1 intervención) el 21/04/2016 00:25:00
Tengo un Web Services donde estoy yendo a traer a un DataSet 4 transacciones pero resulta,
que muestra 4 transacciones pero la ultima trasaccion siempre la repite, adjunto imagen.
Registrods


Este es el codigo donde lleno mi variable Respuestas.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<WebMethod()> _
    Public Function ServicesDetalle(ByVal Receipt_NO As String) As List(Of RespuestaDatosDetalle)
        Dim Retornos As New RespuestaDatosDetalle
        Dim Respuestas As New List(Of RespuestaDatosDetalle)
        Dim ArryList As New ArrayList From {Respuestas}
        Dim sql As New SqlConnection
        Dim sqlplan As New SqlConnection
        Dim comandoStr As New SqlCommand()
        Dim dataAdapter As New SqlDataAdapter(comandoStr)
        Dim audi As New ConexionSql
        Dim i As Integer
        Dim x As Integer
        Dim ds As DataSet = audi.CapturaErrorDs4(Receipt_NO, "SpFiltro_ReceiptNoDetalle", CommandType.StoredProcedure, False)
        If ds.Tables.Count > 0 Then
            For Each dr As DataRow In ds.Tables.Item(0).Rows
                'For i = 0 To ds.Tables.Item(0).Rows.Count + 10
                For i = 0 To dr.Table.Rows.Count + 11
                    Select Case x
                        Case 0
                            Retornos.ReceiptNo = dr(i)
                        Case 1
                            Retornos.LineNo = dr(i)
                        Case 2
                            Retornos.Description = dr(i)
                        Case 3
                            Retornos.UnitofMeasure = dr(i)
                        Case 4
                            Retornos.StoreNo = dr(i)
                        Case 5
                            Retornos.PosTerminalNo = dr(i)
                        Case 6
                            Retornos.SalesStaff = dr(i)
                        Case 7
                            Retornos.Quantity = dr(i)
                        Case 8
                            Retornos.VatAmount = dr(i)
                        Case 9
                            Retornos.Number = dr(i)
                        Case 10
                            Retornos.SalaOrigen = dr(i)
                        Case 11
                            Retornos.TransaccionOriginal = dr(i)
                        Case 12
                            Retornos = New RespuestaDatosDetalle(Retornos.ReceiptNo, Retornos.LineNo, Retornos.Description, Retornos.UnitofMeasure, Retornos.StoreNo, Retornos.PosTerminalNo, Retornos.SalesStaff,
                             Retornos.Quantity, Retornos.VatAmount, Retornos.Number, Retornos.SalaOrigen, Retornos.TransaccionOriginal)
                            Exit For
                    End Select
                    x = x + 1
                Next i
                i = i + 1
                Respuestas.Add(Retornos)
                x = 0
            Next dr
            i = 0
        End If
        Return Respuestas
    End Function

Le agradezco de ante mano vuestra ayuda de buena Fe.
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder