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.
Me.CustomerTableAdapter.Fill(Me.CustomerDataSet.Customer)
End Sub
Private Sub NCButton_Click(sender As Object, e As EventArgs) Handles NCButton.Click
Me.CustomerBindingSource.AddNew()
End Sub
Private Sub SaveButton_Click(sender As Object, e As EventArgs) Handles SaveButton.Click
Me.Validate()
Me.CustomerBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.CustomerDataSet)
End Sub
End Class