Results 1 to 2 of 2

Thread: Problems saving data to database

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2007
    Posts
    4

    Problems saving data to database

    Total newb to any and all programming...been going through some tutorials off Microsoft's learning sites for Visual Basic and so far everything's been going fine til this latest lesson on retrieving and saving data from databases

    Running Visual Basic 2005 Express edition, with SQL Server 2005 Express Edition...database I'm working with is just TestDB.mdb with a single table named Customer

    From what I can tell I've put in all the code correctly as shown in the video demonstration that I was provided (i'll paste further on). What happens is when I go to run or debug the program, I'll make changes to the records and click the button to trigger the event to save the changes, however they aren't showing up when I go to the database and show the table data (next time I run the program the changes are not present either).

    Anything obvious that I've done wrong? Or any hints as to what I might try? Any thoughts would be appreciated! I hate moving forward in these lesson demos until I figure out why I'm stuck on the current lesson

    Here's the code:
    vb.net Code:
    1. Public Class Form1
    2.  
    3.     Private Sub CustomerBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CustomerBindingNavigatorSaveItem.Click
    4.         Me.Validate()
    5.         Me.CustomerBindingSource.EndEdit()
    6.         Me.CustomerTableAdapter.Update(Me.TestDBDataSet.Customer)
    7.  
    8.     End Sub
    9.  
    10.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    11.         'TODO: This line of code loads data into the 'TestDBDataSet.Customer' table. You can move, or remove it, as needed.
    12.         Me.CustomerTableAdapter.Fill(Me.TestDBDataSet.Customer)
    13.  
    14.     End Sub
    15. End Class
    Thanks all!
    Last edited by Hack; Sep 26th, 2007 at 12:06 PM. Reason: Added Highlight Tags

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width