saluut tout le monde j'essaye de devlloper une application qui gère une base de données en utulisant le vb.net et j'ai un probleme avec l'execution des requete avec le datareader aider moi SVP je suis coincéé là dedans. voici le code que j'ai ecrit
et merci avous tous

Code vb.net : 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
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
Imports System.Data.OleDb
Public Class application
    Dim con As New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\kacimi\Documents\basededepanage.accdb")
    Dim commande1 As New OleDbCommand
    Dim Rd As OleDbDataReader
 
 
 
    Private Sub NouveauToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NouveauToolStripMenuItem1.Click
        Me.GroupBox2.Visible = True
        Me.Labelnumserie.Visible = True
        Me.Textnumserie.Visible = True
        Me.GroupBox1.Visible = True
    End Sub
 
 
    Private Sub Textnumserie_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Textnumserie.TextChanged
        If Me.Textnumserie.Text <> "" Then
            Me.Button1.Visible = True
        End If
    End Sub
 
    Private Sub ToolStripMenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rep_nouveau.Click
        'evenement declenché lors du click sur nouveau reparation
        If GroupBox1.Visible = True And GroupBox2.Visible = True Then
            GroupBox1.Visible = GroupBox2.Visible = False
        End If
        Me.GroupBox2.Visible = True
        Me.Labelnumserie.Visible = True
        Me.Textnumserie.Visible = True
    End Sub
 
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        'evenement declenché lors du click sur le button quitter
        If MsgBox("vous voulez vraiment Quitter l'application", 36, "Quitter") = 6 Then
            Close()
        End If
    End Sub
 
    Private Sub Button1_Click_2(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
 
        Dim x As String
 
        con.Open()
        If con.State = ConnectionState.Open Then
 
            commande1.CommandText = "select  service from mat where (numdeserie=textnumserie.text )"
            commande1.Connection = con
 
            Rd = commande1.ExecuteReader
            Rd.Read()
            If Rd.HasRows Then
                Rd.Read()
                GroupBox1.Visible = True
                utulisateur.Text = Rd(0)
                libelle.Text = Rd(1)
                service.Text = Rd(2)
                num_appelle.Text = Rd(3)
                utulisateur.Enabled = False
                libelle.Enabled = False
                service.Enabled = False
                num_appelle.Enabled = False
                GroupBox3.Visible = True
 
            Else
                MsgBox("table vide")
 
            End If
 
            commande1.Dispose()
            con.Close()
 
        Else
            MsgBox("la connexion a echoué")
        End If
 
    End Sub
 
 
    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        If utulisateur.Text <> "" Or Textnumserie.Text <> "" Or service.Text <> "" Or num_appelle.Text <> "" Then
            utulisateur.Text = Nothing
            Textnumserie.Text = Nothing
            service.Text = Nothing
            num_appelle.Text = Nothing
        End If
 
    End Sub
 
    Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
 
    End Sub
 
    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        GroupBox1.Visible = True
 
        TextBox1.Text = "kacimi"
 
    End Sub
End Class