Solved

AxWindowsMediaPlayer & File String

Posted on 2007-11-16
2
1,840 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
2 Comments
 
LVL 18

Accepted Solution

by:
armoghan earned 500 total points
Comment Utility
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
Comment Utility
Thanks very much armoghan.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
This video discusses moving either the default database or any database to a new volume.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

763 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now