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 |
Partager