bonjour,
j'ai voulu essayé d'executer 2 actions mais 1 seule fonctionne et la seconde me donne un message d'ereur:
Une exception de première chance de type 'System.InvalidOperationException' s'est produite dans System.Data.dll
et je n'ai pas l'affichage de mon image
quand je click sur la vignette d'image j'ai le message d'erreur et apres si je click sur play ma video se lit bien.
voici le 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
21
22
23
24
25
  Private Sub AxWindowsMediaPlayer1_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AxWindowsMediaPlayer1.Enter
        Dim cmd As OleDbCommand = cn.CreateCommand        
        Dim i As Integer
        Dim Xwmp As IWMPMedia
        cmd.CommandText = "SELECT clip FROM test WHERE [n°] =1"
        Dim LectureLigne As OleDbDataReader = cmd.ExecuteReader
        While LectureLigne.Read()
            Xwmp = AxWindowsMediaPlayer3000.newMedia(LectureLigne(0))
            AxWindowsMediaPlayer3000.currentPlaylist.insertItem(0, Xwmp)
        End While
        cmd.CommandText = "SELECT clip FROM testa WHERE [n°] =1"
        Dim LectureLignejpg As OleDbDataReader = cmd.ExecuteReader
        While LectureLignejpg.Read()
            For i = 1 To 20
                Xwmp = DirectCast(Me.Controls("AxWindowsMediaPlayer" & i), AxWindowsMediaPlayer).newMedia(LectureLignejpg(0))
                DirectCast(Me.Controls("AxWindowsMediaPlayer" & i), AxWindowsMediaPlayer).currentPlaylist.insertItem(0, Xwmp)
                DirectCast(Me.Controls("AxWindowsMediaPlayer" & i), AxWindowsMediaPlayer).Ctlcontrols.play()
                DirectCast(Me.Controls("AxWindowsMediaPlayer" & i), AxWindowsMediaPlayer).Ctlcontrols.pause()
            Next i
        End While
 
        LectureLigne.Close()
        LectureLignejpg.Close()
        cn.Close()
    End Sub
merci