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
|
Private con As New SqlConnection("Data Source=MTIRI-PC; Initial Catalog=base-ets-mtiri;integrated security=true; ")
Dim dst As New DataSet
Dim adpt As New SqlDataAdapter("select * from FACTURELIGNE where LREF=" & Me.txtCustomComplete.Text & " ", con)
adpt.Fill(dst, "table")
Dim k As Integer
Dim i As Integer = 0
For k = 0 To dst.Tables("table").Rows.Count - 1
Dg.Rows(i).Cells(1).Value = dst.Tables("table").Rows(k).Item(16) & vbCrLf
Dg.Rows(i).Cells(3).Value = dst.Tables("table").Rows(k).Item(13) & vbCrLf
Dg.Rows(i).Cells(0).Value = dst.Tables("table").Rows(k).Item(8) & vbCrLf
Dg.Rows(i).Cells(2).Value = dst.Tables("table").Rows(k).Item(12) & vbCrLf
i = i + 1
Next
'*********la deuxième table **************
Dim dstart As New DataSet
Dim adptart As New SqlDataAdapter("select * from ARTICLE where ART=" & Me.Dg.Rows(0).Cells(0).Value & " ", con)
adptart.Fill(dstart, "tableart")
For k = 0 To dstart.Tables("tableart").Rows.Count - 1
Dg.Rows(i).Cells(4).Value = dstart.Tables("tableart").Rows(k).Item(3) & vbCrLf
i = i + 1
Next
End If
End If
End Sub |
Partager