Carla Romere
asked on
Basic VB.net Visual Studio 2008 Question
I am trying to help out a friend with a very simple Windows application based on VB using Visual Studio 2008 and an Access database. I don't have any problems with web-based applications, but this Windows application has me stumped. I have three tables (customers, sales, inventory), and three pages where users can enter, edit information, etc. I created the forms by dragging the customers table to a windows form and the tool strip was automatically generated with the Add/Delete/Update buttons. In the table adapter I chose Advanced Option and selected "Generate Insert, Update and Delete Statements" and left "Optimistic Concurrency" checked. Then I chose "Fill a DataTable" and "Create methods to send updates directly to the database (GenerateDBDirectMethods). I click finish and it says they are all added. So far so good.
I can add records to all three tables on separate forms using the tool strip add button. I can save them and it appears they are saved. However, they are not getting written back to the database from the dataset and I thought that was supposed to happen automatically from the settings I chose.
Someone help me figure out why this isn't working. I haven't worked with VB in years.
I can add records to all three tables on separate forms using the tool strip add button. I can save them and it appears they are saved. However, they are not getting written back to the database from the dataset and I thought that was supposed to happen automatically from the settings I chose.
Someone help me figure out why this isn't working. I haven't worked with VB in years.
ASKER
When the project is open in VS, I see the Access database that's contained in the project. I'm using the dataset generated automatically when I imported the database. If I open the database itself, the new data is not there. But when I run reports from within the application, some of them show the new data and others do not.
This is the code behind the "Save" button in the Toolstrip. This was automatically generated also.
This is the code behind the "Save" button in the Toolstrip. This was automatically generated also.
Private Sub CustomerBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CustomerBindingNavigatorSaveItem.Click
Me.Validate()
Me.CustomerBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.Grins_and_GigglesDataSet)
End Sub
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
I recreated the project and the tables are updating correctly now.
It's possible that you're actually connected to a copy of the db that was moved into the project folder (depending on the options you chose when you selected the database). Look in the Project folder (as well as any subfolders) to see if a copy of the db was moved there.