S
skyjoker1
I think what I'm trying to do is something relatively simple. I have
created a DataTable using the SQLDataAdapter.Fill method:
Dim da As New SqlDataAdapter("SELECT * FROM Trans", cn)
Dim ds As New DataSet
da.Fill(ds, "AllTrans")
I am currently editing the table records individually by selecting a
subset of the data using a DataView and using the DataRowView.BeginEdit
and DataRowView.EndEdit methods. For example:
Dim dv As New DataView(ds.Tables("AllTrans"))
dv.RowFilter = "A1 = 'ABC'"
Dim drv As DataRowView
For Each drv In dv
drv.BeginEdit()
drv("S1") = "NC"
drv.EndEdit()
Next
However I would like to instead update the DataSet using the equivalent
of an update statement, e.g. "UPDATE AllTrans SET S1 = 'NC' WHERE A1 =
'ABC'".
I am not trying to update the original data source.
Thanks.
created a DataTable using the SQLDataAdapter.Fill method:
Dim da As New SqlDataAdapter("SELECT * FROM Trans", cn)
Dim ds As New DataSet
da.Fill(ds, "AllTrans")
I am currently editing the table records individually by selecting a
subset of the data using a DataView and using the DataRowView.BeginEdit
and DataRowView.EndEdit methods. For example:
Dim dv As New DataView(ds.Tables("AllTrans"))
dv.RowFilter = "A1 = 'ABC'"
Dim drv As DataRowView
For Each drv In dv
drv.BeginEdit()
drv("S1") = "NC"
drv.EndEdit()
Next
However I would like to instead update the DataSet using the equivalent
of an update statement, e.g. "UPDATE AllTrans SET S1 = 'NC' WHERE A1 =
'ABC'".
I am not trying to update the original data source.
Thanks.