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
|
'variable pour checker la date
Dim mois As Integer = 0
Dim année As Integer = 0
mois = Today.Month
année = Today.Year
'Ajout d'une colonne vide pour l'affichae
workTable.Columns.Add(" ")
Dim text As String = ""
For x As Integer = mois To 12
text = x.ToString() + "/" + Today.Year.ToString()
workTable.Columns.Add(text)
Next
For x As Integer = 0 To 12
text = x.ToString() + "/" + (Today.Year + 1).ToString()
workTable.Columns.Add(text)
Next
connexion_base("Liste")
Dim myCommand As New SqlCommand("Select Distinct Liste From ListeHab ", nom_connexion)
Dim myReader As SqlDataReader = myCommand.ExecuteReader()
While myReader.Read()
If Convert.ToString(myReader.GetValue(0)).Replace(" ", "") <> "" Then
workTable.Rows.Add(Convert.ToString(myReader.GetValue(0)))
End If
End While
deconnexion_base()
DataGridView1.DataSource = workTable
End Sub |