
Simple update to a row in a table in an SQL Server database
I am using Visual Studio.net and trying to update a very
simple form. The form consists of (4) text boxes. The
first text box, employeeid, is used by the user as an
input box. Based on the value, a parameterized query is
used to select the (1) employeeid, (2) Last Name and (3)
First Name. I am using a data adapter and dataset to
retrieve the data. The text boxes are bound to the text
property using Visual Studio.Net.
Let's say the user changes the first name from William to
Bill. After making the change in the text box, the user
would click the Save command button. On this clicked
event I have a statement that updates the data adapter.
The problem is - nothing gets updated. From what I have
read, Visual Studio takes care of updating the dataset
through its data binding architecture, as long as I have
bound the text boxes to the appropriate fields in the
datatable. (using visual studio's property list for each
text box). I tried adding 'Accept Changes' but that
didn't work either.
Although the query only retrieves one row (for the
employeeid), I decided to put a navigation button there to
see if that has any effect. And it turns out that when I
hit the navigation button, before hitting the 'save'
button, it updates all right. But, in this case I don't
need the navigation button. So there must be something
I'm forgetting.
There is probably a simple answer, but I just don't know
what it is --
Thanks for your help.