D
DraguVaso
Hi,
I have to update Some records in a DataSet, I now use this functions:
Dim NewDataRow As DataRow
'dtsXmldFormSettings = the DataSet
NewDataRow = dtsXmldFormSettings.Tables("elmFormSettings").NewRow
'waarden schrijven
NewDataRow("FormName") = Me.Name
NewDataRow("FormKey") = pryFolder
NewDataRow("Left") = Me.Left
NewDataRow("Top") = Me.Top
NewDataRow("Height") = Me.Height
NewDataRow("Width") = Me.Width
'add to DataSet
dtsXmldFormSettings.Tables("elmFormSettings").Rows.Add(NewDataRow)
What my code does is just adding every time a new record, even if it is
already in it.
Does anybody knows how to update the DataSet instead of Adding a new record?
My goal is: if there isn't already a record in it with the same FormName and
FormKey, it must be added in the DataSet. If there is already a record in
it, it have to update the existing record.
Thanks in advance,
Pieter
I have to update Some records in a DataSet, I now use this functions:
Dim NewDataRow As DataRow
'dtsXmldFormSettings = the DataSet
NewDataRow = dtsXmldFormSettings.Tables("elmFormSettings").NewRow
'waarden schrijven
NewDataRow("FormName") = Me.Name
NewDataRow("FormKey") = pryFolder
NewDataRow("Left") = Me.Left
NewDataRow("Top") = Me.Top
NewDataRow("Height") = Me.Height
NewDataRow("Width") = Me.Width
'add to DataSet
dtsXmldFormSettings.Tables("elmFormSettings").Rows.Add(NewDataRow)
What my code does is just adding every time a new record, even if it is
already in it.
Does anybody knows how to update the DataSet instead of Adding a new record?
My goal is: if there isn't already a record in it with the same FormName and
FormKey, it must be added in the DataSet. If there is already a record in
it, it have to update the existing record.
Thanks in advance,
Pieter