|
-
Apr 30th, 2004, 08:23 AM
#1
Thread Starter
New Member
Problem adding to a database
When I add to the DB the "title" of the movie dissapears but everything else (length, StoreID, etc) all show up. what is the deal? Here is the code for the save button.
Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsave.Click
'Allows the user to save an entry
If ValidData() And ValidCategory() Then
Dim newRow As DataRow = Dsvideo3.Video.NewRow
Try
'Complete the current edit operation
Me.BindingContext(Dsvideo3, "Video").EndCurrentEdit()
'Update the database table
davideo.Update(Dsvideo3, "Video")
'Reset the dataset
Dsvideo3.AcceptChanges()
'Set the buttons and controls
setbuttons(True)
setcontrols(False)
'Display the current row
newRow("Title") = txtTitle.Text
newRow("Studio ID") = txtStudioID.Text
newRow("Movie Number") = txtVideoID.Text
newRow("Length") = txtLength.Text
newRow("Category") = txtCategory.Text
Me.Displayrow()
Catch eDataError As Exception
MessageBox.Show("Duplicate Entry", "Save Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End If
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|