DataWizard Error

  • Thread starter Thread starter Atley
  • Start date Start date
A

Atley

I have made a data form using the data wizard but when i run it and change
the data on the form, then press the update button, I get "Update requires a
valid UpdateCommand when passed Data Row Collection with modified rows."

How do I get around this error? I have created a dataset from a table (in
the wizard).

Incidentally another table in the same database has a form based on it and
it works perfectly. this table has the exact fields with just different
field names in it, so I am stumped.
 
Hi Atley,

You need to add an update method to handle this update click event.


Dim objDataSetChanges As [ApplicationName].[DatasetName] = New
[ApplicationName].[DatasetName]

Me.BindingContext(obj[DatasetName], "[TableName]").EndCurrentEdit()

objDataSetChanges = CType(obj[DatasetName].GetChanges,
[ApplicationName].[DatasetName])

If (Not (objDataSetChanges) Is Nothing) Then
Try
Me.UpdateDataSource(objDataSetChanges)
obj[DatasetName].Merge(objDataSetChanges)
obj[DatasetName].AcceptChanges()
Catch eUpdate As System.Exception
Throw eUpdate
End Try
End If

Hope this help.

Thanks,
Cynthia
DDSE QA

--------------------
 
Back
Top