Salut ! J'ai eu un erreur lors de l'execusion dans la ligne 13 ! exactement dans (table.Rows.Count)
l'erreur est "Object reference not set to an instance of an object."
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
Private Sub AfficherE_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        driver = "Provider=Microsoft.ACE.oledb.12.0;" & "data source =C:\Users\Med Haroun\Desktop\Mini Projet\ressources\Gestion de Stock.accdb;"
        con = New OleDbConnection()
        con.ConnectionString = driver
        con.Open()
        req = "SELECT * FROM Employe ;"
 
        cmd = New OleDbCommand(req)
        adapter = New OleDbDataAdapter(cmd)
        cmd.Connection() = con
        adapter.Fill(ds, "Employe")
 
        For j = 0 To (table.Rows.Count)
            Label1.Text = table.Rows(j).Item(0) + vbCr
        Next
    End Sub
End Class