bonjour
je voudrais vous solliciter pour savoir comment je puis faire un classement selon la moyenne de chacun.
et comment afficher le résultat dans un datagrid ou une listview,etc/
j'ai essayé ceci mais je ne sais pas comment ajouter le rang de chacun.
je voudrais que celui qui a la plus forte moyenne se voit afficher en face 1ER et ainsi de suite.
Voici mon code :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
  Try
 
 
            Using conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\KEUNENE-PC\ecole\ecole.mdb;")
                conn.Open()
                Dim command As New OleDbCommand("SELECT nom, année_scolaire,AVG(note) from moyenne  where  année_scolaire = '" & annee.Text & "'  GROUP BY inom,année_scolaire order by AVG(note) desc", conn)
                Dim adapter As New OleDbDataAdapter
                Dim dt As New DataTable
                adapter.SelectCommand = command
                adapter.Fill(dt)
                DataGridView1.DataSource = dt
 
                adapter.Dispose()
                command.Dispose()
                conn.Close()
 
            End Using
        Catch ex As Exception
            MsgBox(ex.ToString)
        End Try
merci infiniment pour vos aides!