-
Updating A Database
I have text boxes bound to the the dataset on a form. I also have a datagrid. From the datagrid, I'm able to right changes back to the database table using the update method of the the dataadapter. I want to be able to do the same with text boxes bound to the dataset i.e. update database table using the update method of the dataadepter from the changes made at the text boxes bound to the dataset. The program brings no error at all but the table is not updated. Can anybody help???
-
Are your text boxes bound to the dataset, assuming you've created one as a component in your project already ?
-
Yes! Text boxes are bound to the dataset. I'm even able to display data from the bound dataset on the text boxes. Problem comes when I want to update!!!
-
doesn't this line update it?
Code:
objDataAdapter.update(objDataSet)
where objDataAdapter is the name of your data adapter and objDataSet is the name of your data set.
i am new to this so i might be completely wrong!
-
-
Thanx everybody for ur help. It did update only after I added this line of code just before calling update method
Me.BindingContext(MyDataset.Tables(TableName)).EndCurrentEdit
I got this from one of the books I'm using