Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1877
  • Last Modified:

AxWindowsMediaPlayer & File String

Hi Guys,

I have a form which has about 35 buttons on it. Each button plays a music file. At present the string I use to determine which file to play is like this....

        Dim playlist As WMPLib.IWMPPlaylist
        playlist = Me.AxWindowsMediaPlayer1.newPlaylist("Playlist B1", "")
        Dim item As WMPLib.IWMPMedia = AxWindowsMediaPlayer1.newMedia(Form2.TextBox1.Text)
        playlist.appendItem(item)
        AxWindowsMediaPlayer1.currentPlaylist = playlist

As you can see it finds the file location from the text box on form2. Is there a way of getting it to read directly from the database rather than from the text box on form2?

The database itself has 1 table called Locations and it has 35 fields (1 for each button) labeled Cue 1, Cue 2, etc. etc.

Lee
0
lfaulkneruk
Asked:
lfaulkneruk
1 Solution
 
armoghanCommented:
if you have fetched the datarow  from database
then it would be something like
 Dim playlist As WMPLib.IWMPPlaylist
        playlist = Me.AxWindowsMediaPlayer1.newPlaylist("Playlist B1", "")
Dim item As WMPLib.IWMPMedia
for each col as DataColumn in ds.Tables(0).Columns
item=  AxWindowsMediaPlayer1.newMedia(ds.Tables(0).Rows(0).Item(col.ColName))
 playlist.appendItem(item)
  AxWindowsMediaPlayer1.currentPlaylist = playlist
end for
0
 
lfaulknerukAuthor Commented:
Thanks very much armoghan.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now