R
Rich
Hello,
I have an oleDBDataAdapter (da1) which gets data from an
Access mdb and fills a dataset (ds1) with integer data
from "tbl1" in Access. Data displays in textboxes on a
form. The textboxes are bound to columns in the dataset.
This works correctly. I have been struggling with
invoking da1.Update(ds1, "tbl1") and with help from the
group here have overcome this obstacle (many thanks for
the help). But I need to be able to Insert and Delete
from the same dataset. Do I have to populate the
parameters in da1?
'''''''''''Insert routine
Dim txtCol As TextBox() = New Textbox(){txt0, txt1, txt2}
Dim txt As Textbox
For Each txt in txtCol
da1.InsertCommand.Parameters(i).Value = txtCol(i).Text
Next
da1.Update(ds1, "tbl1")
Note: do I have to do some casting with txtCol
(i).Text? "tbl1" fields are all integer fields and the
data in the form is all integer data.
And then for Delete
da1.DeleteCommand.Parameters("fld0").Value = txt0.Text
da1.Update(ds1, "tbl1"L)
again, is it DirectCast for txt0.Text?
Thanks again for help.
Rich
I have an oleDBDataAdapter (da1) which gets data from an
Access mdb and fills a dataset (ds1) with integer data
from "tbl1" in Access. Data displays in textboxes on a
form. The textboxes are bound to columns in the dataset.
This works correctly. I have been struggling with
invoking da1.Update(ds1, "tbl1") and with help from the
group here have overcome this obstacle (many thanks for
the help). But I need to be able to Insert and Delete
from the same dataset. Do I have to populate the
parameters in da1?
'''''''''''Insert routine
Dim txtCol As TextBox() = New Textbox(){txt0, txt1, txt2}
Dim txt As Textbox
For Each txt in txtCol
da1.InsertCommand.Parameters(i).Value = txtCol(i).Text
Next
da1.Update(ds1, "tbl1")
Note: do I have to do some casting with txtCol
(i).Text? "tbl1" fields are all integer fields and the
data in the form is all integer data.
And then for Delete
da1.DeleteCommand.Parameters("fld0").Value = txt0.Text
da1.Update(ds1, "tbl1"L)
again, is it DirectCast for txt0.Text?
Thanks again for help.
Rich