|
Hi Christian,
Sorry about the muliple posts, this' my first time on the site and I wasn't sure of being in the right forum.
As I indicated, I'm new meat to web dev, currently on ch. 10 of 19 in my Beginner VB05EE book(Peter Wright's Novice to Pro -Apress). I downloaded VWD 05 & 08 about a two weeks ago and got stuck on this problem. I thought that the book would walk me throuh it, but it only left me with a beginners insight, so Im unable to follow your reply.
As for the other code, well there is none. I basically C&P'd something I came across while viewing the video tutorial that came w/ VWD05. Although, are you asking for the VB code, or the asp code?
I've tried several variations on the above code, I even attempted an If statement, however I fumbled miserably.
What ever you can offer would be appreciated.
Thanks in advance.
Arman
|
|
|
|
|
Thanks in advance for any help with my problem. I don't think it is too complicated but I have been unable to figure it out after many hours. I have a program that needs to play an endless loop of different videos, it uses Direct X and plays them in a panel on the form. The problem is as the program runs every new video the memory for the process increases in size until eventually there is an error. I believe that this is because I am never disposing of the video when it is done but when I leave this method and come back after the video is done i do not know how to access the old video to dispose before it opens the next. Here is the related code.
Private Sub OpenMovie(ByVal FileLocation As String)
Dim Height As Integer = VideoAd.Height
Dim Width As Integer = VideoAd.Width
Dim AdVideo As New Microsoft.DirectX.AudioVideoPlayback.Video(FileLocation)
AdVideo.Owner = VideoAd
VideoTimeLeft = Advideo.Duration
Advideo.Play()
Advideo.Audio.Volume = -5000
SecondTimer.Start()
VideoAd.Height = Height
VideoAd.Width = Width
'Advideo.Dispose()
End Sub
VideoAd is a panel
and SecondTimer is the timer that monitors when the video is done playing.
- Richard
|
|
|
|
|
http://www.codeproject.com/KB/directx/DirectX9_media_playback.aspx[^]
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I am trying to insert data into the table and teamID is the foreign key in the Participant table. I get an error essentially indicating that String (TeamName) cannot be converted to Integer (TeamID).
Here is the code...
'Form_Load event
Try
'Create an instance of the data-tier component (GymnasticsMeetData)
Dim teamData As New Data.GymnasticsMeetData
'Retrieve the dataset from the data-tier
Dim TeamDataSet As GymnasticsDataSet
TeamDataSet = teamData.getTeamDataSet
'Set up the binding source
Dim tBindingSource As New BindingSource
With tBindingSource
.DataSource = TeamDataSet
.DataMember = "Team"
.Sort = "TeamID"
End With
'Fill the combobox
With Me
With .teamComboBox
.DataSource = tBindingSource
.DisplayMember = "TeamName"
.ValueMember = "TeamID"
.DataBindings.Add("text", tBindingSource, "TeamName", True, DataSourceUpdateMode.OnValidation)
End With
End With
'UpdateButton_Click event
Dim gymClub As String
Try
gymClub = teamComboBox.ValueMember '(Tried teamComboBox.Text.. did not work)
Model.EnrollClass.GymnastAffiliation = gymClub
clubLabel.Visible = True
clubLabel.Text = gymClub
Catch ex As Exception
MessageBox.Show("String to Int: " & ex.Message)
End Try
'ADO for data access
Dim sqlConnection As SqlConnection = New SqlConnection("Data Source=lp1\sqlexpress;Initial Catalog=Gymnastics;Integrated Security=True")
Dim sqlCommand As SqlCommand
sqlCommand = New SqlCommand("addGymnast", sqlConnection)
sqlCommand.CommandType = CommandType.StoredProcedure
sqlConnection.Open()
Try
Dim sqlParameter3 As SqlParameter = New SqlParameter("@TeamID", SqlDbType.Int)
sqlCommand.Parameters.Add(sqlParameter3)
sqlParameter3.Value = gymClub '(Tried teamComboBox.ValueMember... did not work)
Catch ex As Exception
MessageBox.Show("String to Int: " & ex.Message)
End Try
Dim sqlParameter9 As SqlParameter = New SqlParameter("@RetVal", SqlDbType.Int)
sqlCommand.Parameters.Add(sqlParameter9)
sqlParameter9.Direction = ParameterDirection.Output
If sqlCommand.Parameters("@RetVal").Value > 0 Then
insertStatusLabel.Text = "Success!"
Else
insertStatusLabel.Text = "Failure"
End If
sqlCommand.ExecuteNonQuery()
sqlConnection.Close()
Private Sub teamComboBox_SelectedValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles teamComboBox.SelectedValueChanged
Model.EnrollClass.GymnastAffiliation = (teamComboBox.Text)
End Sub
'In the Model Class
Private Shared m_affiliation As String
Public Shared Property GymnastAffiliation() As String
Get
Return m_affiliation
End Get
Set(ByVal value As String)
m_affiliation = value
End Set
End Property
|
|
|
|
|
It looks like that the problem is related just to the two types not being the same. I have some code that does the same thing figured I would post and see if it helps.
Dim SqlCommand As New System.Data.SqlClient.SqlCommand()
ErrorLbl.Text = ""
SqlCommand.Parameters.Add("@EventID", SqlDbType.Int)
SqlCommand.Parameters("@EventID").Value = EventSelect.SelectedValue.ToString
SqlCommand.Connection = SqlConn
SqlCommand.CommandText = "[DeleteEvent]"
SqlCommand.CommandType = CommandType.StoredProcedure
SqlConn.Open()
SqlCommand.ExecuteNonQuery()
Hope this helps
- Richard
|
|
|
|
|
Here is where I get an error message...
'Fill the combobox
With Me
With .teamComboBox
.DataSource = tBindingSource
.DisplayMember = "TeamName"
.ValueMember = "TeamID"
.DataBindings.Add("text", tBindingSource, "TeamName", True, DataSourceUpdateMode.OnValidation)
End With
End With
Not able to convert String ("TeamID") to Int32. It is reading the ValueMember,TeamID as a string, "TeamID". I am not sure if it is OK to use a parent table to populate the combobox, which is what I have done in this case. Team table is the parent of Participant table.
|
|
|
|
|
EventSelect.SelectedValue.ToString
SqlCommand.CommandText = "[DeleteEvent]"
Can you explain what EventSelect and [DeleteEvent] mean? Which event are you referring to?
Gymnast.
|
|
|
|
|
Hi everybody!
I'm developing a VB.NET 2005 application and I want to use a DataGridView, but I need to disable navigation, so I've been looking for a property like AllowNavigation (like the old DataGrid had) but I don't seem to find it. Is it that the Mycrosoft team removed this property for the new grid?
If somebody knows how I can achieve the same as AllowNavigation but for DataGridView, please, let me know.
Thanks in advance
Kenia
|
|
|
|
|
I've only worked with vb.net 2005...so what do you mean by disable navigation? Or what did the AllowNavigation property do?
|
|
|
|
|
What the property does is to allow the user to select whether to show or not links to child tables. If you know how to achieve this in the DataGridView control, please, let me know.
Thanks,
Kenia
|
|
|
|
|
Dear All,
I am new with VB coding, please help me with this problem.
I have a form including 1 input field, 1 dropdown menu and 1 submit button.
The scenario is:
If I dont move the mouse to the inputfield, and select a dropdown menu. It will automatically activate the submit button to update info. However, in this process, I want it ignore the data in the input field, and update only the item in the dropdown menu.
Could you please help me, i 'm being stuck in this issue for 2 weeks.
I would appreciate your time and your potential helps very much,
|
|
|
|
|
I used to have a good article saved in my favorites about this issue, but the link is no longer active. Here is another one I had saved:
http://weblogs.asp.net/Jeff/archive/2005/07/26/420618.aspx[^]
And you may find more about this by searching for the key words "ASP.NET Default Button" on google or CP.
Hope this helps.
|
|
|
|
|
Hi,
I have 2 proj-a user control project and a web page project(huge web site).
Currently using web deployment, I am creating a dll file for user control project. Then I am referencing this to web page project and build and debug to view the changes in web project.
To avoid this long process, I am trying to build a batch file to build both.
I am able to build the usercontrol using msbuild in the batch file.
Now I am not able to reference this dll file to webpage project and build the web page project using devenv.How do I reference dll file to webpage project in command prompt or in a batch file. Please help
|
|
|
|
|
Travelthrprog wrote: Now I am not able to reference this dll file to webpage project and build the web page project using devenv.
Why not?? All you have to do is add the .DLL project to your web page project in the same solution, then you won't have this problem at all.
|
|
|
|
|
Hi Dave,
I am able to run it manually. But I want to create msbuild .proj file to do it. I just tried building only proj2 by referencing the proj1.dll file as shown below
<project defaulttargets="Compile" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<propertygroup>
<appname>C:\2proj
<optimize>false
<itemgroup>
<inclibs include="C:\1proj\debug\bin\1proj.dll">
<target name="”Compile”">
<target name="”Compile”">
<msbuild projects="C:\2proj" target="c:\2proj\2proj.sln" "="" references="”@(incLibs)”">
But gives an error
Msb4025-invalid characters in the coding
I also don't know how to build the first proj and then add the reference it in the above code.
Please help.
Thanking you,
Nirmala
|
|
|
|
|
i have a form that is being populated with checkboxes added at runtime. VB6.
If Not rsEMPRTYPESSORTED.EOF Then rsEMPRTYPESSORTED.MoveFirst
Do While Not rsEMPRTYPESSORTED.EOF
cIndx = cIndx + 1
ctrlName = "DynChkBx" & CStr(cIndx)
prevctrlName = "DynChkBx" & CStr(cIndx - 1)
Set chkObject = frmEmployer.Controls.Add("VB.CheckBox", ctrlName, Frame3)
Set prevtxtObject = frmEmployer.Controls(prevctrlName)
With chkObject
.Enabled = False
.Visible = True
.Width = 2800
.Height = 255
.MaskColor = 1
.BackColor = &H8000000F
If cIndx = 1 Then
.Visible = True
.Caption = rsEMPRTYPESSORTED!Name
.Top = 10
.Left = 10
Else
.Visible = True
.Caption = rsEMPRTYPESSORTED!Name
.Top = prevtxtObject.Top + prevtxtObject.Height
.Left = 0
End If
End With
rsEMPRTYPESSORTED.MoveNext
Loop
As you can see i don't know the number of controls or the names.
what i need is to attach events to these controls.
I have tried the withevents but as you know it only works with the last control and cannot be use in an array.
all the controls are intrinsic therefore VBControlExtender is out.
modified on Tuesday, February 19, 2008 1:12 PM
|
|
|
|
|
You have to wire-up the events yourself. Lookup AddHandler and RemoveHandler in the MSDN docs for examples.
|
|
|
|
|
Thank you for your response...however i need to be able to accomplish this in vb6.
|
|
|
|
|
the only way to really do this in vb6 is to have a control array. no matter how many checkboxes you create they all will call the same routine passing the index of that one that's changing. then you can test the index to know whether or not to have happen when changing values...
<br />
Private Sub Check1_Click(Index As Integer)<br />
If Index = 0 The<br />
.<br />
.<br />
.<br />
End If<br />
End Sub
'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous
'Life's real failure is when you do not realize how close you were to success when you gave up.' ~ anonymous
|
|
|
|
|
There is no equivilent in VB6.
It's been about 7 years since I've used it, so I can't remember how you had to do it. I think you have to create a control array with a known name, then add to that array when you wanted to add controls to it. The event handler had to have the same name as the control array in order to get wired up. ... I think ...
|
|
|
|
|
Thanks again for everyones input.
If i were to use a control array for the checkboxes...can i still use the 'controls.add' to add new members to the array and to frame3 as in 'Set chkObject = frmEmployer.Controls.Add("VB.CheckBox", ctrlName, Frame3)'...? I do not believe that the 'load' statement will accomplish this.
Ultimately, I want to add the checkboxes to frame3 (it has a specified height at design time) and then scroll the checkboxes within it (frame3) if the total height of all checkboxes gets to be > the height of the frame, then catch the individual click events. an array will accomplish the click event problem but i dont know if I can still add them to the scrolling frame without using 'controls.add'.
|
|
|
|
|
lesstraveled wrote: If i were to use a control array for the checkboxes...can i still use the 'controls.add' to add new members to the array and to frame3 as in 'Set chkObject = frmEmployer.Controls.Add("VB.CheckBox", ctrlName, Frame3)'...? I do not believe that the 'load' statement will accomplish this.
The Load statement has nothing to do with creating controls.
Under VB.NET, you can do something like:
Dim newControl As New CheckBox
' setup the properties of the control here...
Me.Controls.Add(newControl)
I think you can do the same thing under VB6, or something very close to it.
<blockquote class="FQ"><div class="FQA">lesstraveled wrote:</div>but i dont know if I can still add them to the scrolling frame without using 'controls.add'. </blockquote>
How about trying it to see what happens??
|
|
|
|
|
you can do something like this to put the controls in the frame.
Dim i As Integer
Set Check1(0).Container = Frame1
Check1(0).Top = 10
Check1(0).Left = 10
For i = 1 To 10
Load Check1(i)
Set Check1(i).Container = Frame1
Check1(i).Left = 10
Check1(i).Top = Check1(i - 1).Top + Check1(i).Height
Check1(i).Visible = True
Next
'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous
'Life's real failure is when you do not realize how close you were to success when you gave up.' ~ anonymous
|
|
|
|
|
nlarson11...'Set DynChkBx0(0).Container = Frame3'---perfect, that was exactly what i was looking for. Thank You!
|
|
|
|
|
Would anyone be kind enough to assist me with an issue i am having binding the user input through Radio buttons to a field (ExemptStatus) in my access database?
Dim grbExemptStatus As String
'declare radio buttons for Exempt values
If radNonExempt.Checked = True Then
grbExemptStatus = "Non Exempt"
End If
If radExempt.Checked = True Then
grbExemptStatus = "Exempt"
End If
On my User Form, I have a "Exempt" & "NonExempt" within a groupbox called "Exempt Status". I would like the user selection to be passed to a my access database; tblEmployee; fieldname = ExemptStatus. I have tried user Select case as well as If checked = true, but none of that is producing the desired result. Instead the value passed to my table is "exempt status?. Please help! TIA
modified on Tuesday, February 19, 2008 12:27 PM
|
|
|
|