I'm doing a project where I want Data to be saved to a database ALWAYS. :) When Im in debug the data is saved and it is even saved while the program is running and saved after it closes. As soon as i open the program back up the data disappears. I've tried everything..using oledbconnection no go. Using sqlconnection no go. I was getting errors left and right. I looked at the tutorial for oledbconnections. I thought it might be row count? I finally decided to simply use the addnew and save code under the database tools Although that code is alot easier Here's my code:

Public Class MainForm

Private Sub MainForm_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    'TODO: This line of code loads data into the 'CustomerDataSet.Customer' table.

End Sub

Private Sub NCButton_Click(sender As Object, e As EventArgs) Handles NCButton.Click
End Sub

Private Sub SaveButton_Click(sender As Object, e As EventArgs) Handles SaveButton.Click
End Sub

End Class

2 Years
Discussion Span
Last Post by Reverend Jim

As soon as i open the program back up the data disappears.

That sounds like you're doing something to truncate the table(s) when the application loads. I'd start by tracing what happens as the application loads in the debugger and keep an eye on the database to narrow down when exactly this data loss occurs.


It happens when I re-open the program. It doesn't save any of the data i imput previously and starts me back at row 0 to save data to. even if i put it at the 3rd row ...row 1 and 2 have disappeared.


Is it possible that you are updating an in-memory copy of the database that is not getting saved to the actual database?

This article has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.