G
Graham Blandford
Hi all,
Would someone be able to tell me the most 'graceful' way of removing
unwanted rows from a dataset based on a condition prior to update? OR,
resetting the rows all to unchanged after they are initally added to the
recordset.
I create a dataset, which begins empty after the initial .Fill.
Then I create several rows with some default information, leaving one
critical piece of information value as 0;
dr = ds.Tables("mytable").NewRow()
With dr
.Item("basicdata1") = myvalue1
.Item("basicdata2") = myvalue2
.Item("criticaldata") = 0
.Item("created") = Now()
End With
ds.Tables("mytable").Rows.Add(dr)
Then, my update does something like;
da.Update(ds, "mytable")
All pretty basic stuff.... but what I would like is to ONLY insert new rows
into the database that have a "criticaldata" value <> 0 and discard the
rest. I could use the GetChanges method if I knew how to mark the rows as
'unchanged' immediately after creation - but don't know how.
Any help would be greatly appreciated.
Thanks,
Graham
Would someone be able to tell me the most 'graceful' way of removing
unwanted rows from a dataset based on a condition prior to update? OR,
resetting the rows all to unchanged after they are initally added to the
recordset.
I create a dataset, which begins empty after the initial .Fill.
Then I create several rows with some default information, leaving one
critical piece of information value as 0;
dr = ds.Tables("mytable").NewRow()
With dr
.Item("basicdata1") = myvalue1
.Item("basicdata2") = myvalue2
.Item("criticaldata") = 0
.Item("created") = Now()
End With
ds.Tables("mytable").Rows.Add(dr)
Then, my update does something like;
da.Update(ds, "mytable")
All pretty basic stuff.... but what I would like is to ONLY insert new rows
into the database that have a "criticaldata" value <> 0 and discard the
rest. I could use the GetChanges method if I knew how to mark the rows as
'unchanged' immediately after creation - but don't know how.
Any help would be greatly appreciated.
Thanks,
Graham