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
|
Public Sub Etat_Client()
Dim ClasseGenerale As New clConnexion
Dim dst As New DataSet2
Dim cl As New clConnexion
Dim MaConn As New OdbcConnection
MaConn = cl.oConnexion
Dim MonDataRow As DataRow
Dim MondataSet As New DataSet
MaConn.Open()
Dim Mondataadapter As OdbcDataAdapter
Dim Requete As String = "select distinct * from T_etat_client order by montant_cli ASC"
Mondataadapter = New OdbcDataAdapter(Requete, MaConn)
Mondataadapter.Fill(MondataSet)
Dim val As Integer = MondataSet.Tables(0).Rows.Count
dst.Clear()
Dim i As Integer
For i = 0 To val - 1
MonDataRow = dst.T_etat_client.NewRow
MonDataRow("code_cli") = MondataSet.Tables(0).Rows(i).Item("code_cli")
MonDataRow("nom_cli") = MondataSet.Tables(0).Rows(i).Item("nom_cli")
MonDataRow("prenom_cli") = MondataSet.Tables(0).Rows(i).Item("prenom_cli")
MonDataRow("code_v") = MondataSet.Tables(0).Rows(i).Item("code_v")
MonDataRow("date_v") = MondataSet.Tables(0).Rows(i).Item("date_v")
MonDataRow("montant_v") = MondataSet.Tables(0).Rows(i).Item("montant_v")
MonDataRow("montant_cli") = MondataSet.Tables(0).Rows(i).Item("montant_cli")
MonDataRow("credit_restant") = MondataSet.Tables(0).Rows(i).Item("credit_restant")
dst.T_etat_client.Rows.Add(MonDataRow)
Next
Dim rpt As New CrtEtaCli
rpt.SetDataSource(dst)
Me.CrvEtaCli.ReportSource = rpt
MaConn.Close()
MaConn.Dispose()
End Sub |
Partager