database help and video file help

jason1987

Member
Joined
Apr 15, 2007
Messages
14
Programming Experience
Beginner
I am doing a deal or no deal game, i need help with adding a score into a database at the end, i have a textbox on my form where the user can enter their name, and i need to take the score from a label with it as the text on there. I have already created my database with access and linked it up on another form to display what is already on the database, i just need help in adding new score's to it so the user can.
can anyone help me out?
so far i have this its not likng the red bits though, wht are these bits referring to?
thanks, i have used tht code, however it isnt likeing the query bits in red below

VB.NET:
Dim query = "INSERT INTO table (col1, col2) VALUES (@Name, @Score)"
        Dim cn As OleDb.OleDbConnection = New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\db1.mdb")
        Dim cmd As OleDb.OleDbCommand = New OleDb.OleDbCommand(query, cn)
        cmd.Parameters.AddWithValue("@Name", Me.TextBox1.Text)
        cmd.Parameters.AddWithValue("@Score", Me.Label1.Text)
        Try
            cn.Open()
            cmd.ExecuteNonQuery()
            highScoreForm.Query1TableAdapter.ClearBeforeFill = True
            highScoreForm.Query1TableAdapter.Fill(highScoreForm.HighscoresDataSet.Query1)
            'clear.highscoresDataSet()
            'Load.highscoresDataSet()
        Catch ex As Exception
            MessageBox.Show(ex.Message)
        Finally
            cn.Close()
        End Try
        highScoreForm.Show()
        Me.Hide()
secondly -
I need help in playing a video file on a form as soon as the form is loaded up the file is sat in the media player which i have added windows media player that is, all the user needs to do is press play, i haven't got a clue where to even start with this code, any help be great, i have this so far and obviously got the media player on my form
VB.NET:
Private Sub AboutForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'Microsoft.DirectX.AudioVideoPlayback()
        'Dim MYvideo As New Video("C:\Documents and Settings\Jason\Desktop\project1\project1", Autorun - yes)
    End Sub
thanks j
 
Last edited:
Problem Two

Try this for your second problem.

1. Make sure DirectX extensions are available in visual studio, if not you can get them from Microsoft.

2. On your form add a reference to Microsoft.DirectX.AudioVideoPlayback

3. Add the following line to your forms onload sub.
Dim MYvideo As new Video(path to video,Autorun-yes\no)

4. Add a command button with 'Play' on it and the following code in its sub
MYvideo.Play

I thinks that right, any problems just post back.
 
Back
Top