R
Rich
Hello,
On a form I have 3 textboxes, txt0, txt1, txt2 which
contain all integers. I have also placed a connection
component (conn), dataadapter component (da1) and dataset
component (ds1) from the toolbox on to the form. I
established a connection to an Access mdb file and can
display data correctly on the form in the textboxes. The
textboxes are bound to columns in the dataset. So the
only code I have to populate the form is on the Form_Load
event
ds1.Clear
da1.Fill(ds1, "tbl1")
This works fine. But if I change/modify the data in one
of the textboxes and execute
da1.Update(ds1, "tbl1")
the data does not get updated in Access. I have tried
populating the parameters for the
da1.UpdateCommand.Parameters collection
da1.UpdateCommand.Parameters("fld1").Value = txt1.text
(while I'm at it, the above line didn't work either -
problem casting text to int - how to do that properly?)
so I did the following:
da1.UpdateCommand.Parameters("fld1").Value = 1234
da1.Update(ds1, "tbl1")
but this did not update tbl1 either. How do I make the
dataAdapter work to update?
Thanks,
Rich
On a form I have 3 textboxes, txt0, txt1, txt2 which
contain all integers. I have also placed a connection
component (conn), dataadapter component (da1) and dataset
component (ds1) from the toolbox on to the form. I
established a connection to an Access mdb file and can
display data correctly on the form in the textboxes. The
textboxes are bound to columns in the dataset. So the
only code I have to populate the form is on the Form_Load
event
ds1.Clear
da1.Fill(ds1, "tbl1")
This works fine. But if I change/modify the data in one
of the textboxes and execute
da1.Update(ds1, "tbl1")
the data does not get updated in Access. I have tried
populating the parameters for the
da1.UpdateCommand.Parameters collection
da1.UpdateCommand.Parameters("fld1").Value = txt1.text
(while I'm at it, the above line didn't work either -
problem casting text to int - how to do that properly?)
so I did the following:
da1.UpdateCommand.Parameters("fld1").Value = 1234
da1.Update(ds1, "tbl1")
but this did not update tbl1 either. How do I make the
dataAdapter work to update?
Thanks,
Rich