hello, I have form with a listbox and a windows media player. The lisbox is populated with filename from the database. If the user select one item from listbox a video clip should play on the WMP. In the mysql database, I have a table VideoClips with fields vName(varchar), vLocation(varch ar). In vLocation I saved the file path of the picture (D:\VBProject\v ideos\video.flv ).
there's no error, the problem is that when I select an item in the list it displays the catch exception message "no file" even if I already have the full path of the video stored in the database (example: D:\VBProject\vi deos\video.flv) . Can anybody help me work it properly? this is quite urgent, I need to finish this today. Please help me, God bless
Code:
Call Connect()
With Me
STRSQL = "select vLocation from movie where vName = @vName"
Try
myCmd.Connection = myConn
myCmd.CommandText = STRSQL
myReader = myCmd.ExecuteReader
myCmd.Parameters.AddWithValue("@vName", lstName.SelectedItem.ToString())
If myReader.Read Then
Dim path = myReader.GetString(0)
wmp.URL = path
End If
Catch ex As Exception
MsgBox("no file")
End Try
End With
Comment