Saving data with data-bound Form Controls
-
Hello again! For the past two days and nights, I am struggling with my data-bound form to save the changes, I make. I have completely exhausted the Web for finding a clue. I M doing exactly the same as suggested everywhere, but in vain. As one example, I M using the NorhtwindDataSet and has dropped only 3 Fields - ProductID, ProductName, and the UnitPrice from the Products table (in detail view) on to the form. The Navigator displays all the records without any problem. When I modify any value from any of the 3 fields, it accepts obediently. But, when I run the form again, No modification is there - showing all the older ones. The auto-generated code behind is as below:
Private Sub ProductsBindingNavigatorSaveItem_Click_3(sender As Object, e As EventArgs) _
Handles ProductsBindingNavigatorSaveItem.Click
Me.Validate()
Me.ProductsBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.NorthwindDataSet)
End SubI tried my own Save button, and copied the above code in its Procedure, with no luck. I have tried this with plenty of databases, including my own database tables as well, with exactly the same problem. I M so much frustrated that I feel like quitting my job. Please help me, taking me as a novice. Regards
-
Hello again! For the past two days and nights, I am struggling with my data-bound form to save the changes, I make. I have completely exhausted the Web for finding a clue. I M doing exactly the same as suggested everywhere, but in vain. As one example, I M using the NorhtwindDataSet and has dropped only 3 Fields - ProductID, ProductName, and the UnitPrice from the Products table (in detail view) on to the form. The Navigator displays all the records without any problem. When I modify any value from any of the 3 fields, it accepts obediently. But, when I run the form again, No modification is there - showing all the older ones. The auto-generated code behind is as below:
Private Sub ProductsBindingNavigatorSaveItem_Click_3(sender As Object, e As EventArgs) _
Handles ProductsBindingNavigatorSaveItem.Click
Me.Validate()
Me.ProductsBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.NorthwindDataSet)
End SubI tried my own Save button, and copied the above code in its Procedure, with no luck. I have tried this with plenty of databases, including my own database tables as well, with exactly the same problem. I M so much frustrated that I feel like quitting my job. Please help me, taking me as a novice. Regards