Solved

AxWindowsMediaPlayer & File String

Posted on 2007-11-16
2
1,868 Views
Last Modified: 2010-04-21
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
Comment
Question by:lfaulkneruk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 18

Accepted Solution

by:
armoghan earned 500 total points
ID: 20312001
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
 

Author Closing Comment

by:lfaulkneruk
ID: 31409575
Thanks very much armoghan.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Suggested Courses

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question