D
darjonase
I am having a problem, and I wonder if anyone could help me with it. I
have two methods. The first on a form calls the second method which is
located in a class lib.
'Form Method
Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnSave.Click
'If imageDataSet.HasChanges Then
_databaseMethods.ProcessUpdates(imageDataSet)
'End If
End Sub
'Class Method
Public Sub ProcessUpdates(ByRef dsData As DataSet)
Try
If dsData.HasChanges(DataRowState.Modified) Then
Dim dsChangedDataSet As DataSet
dsChangedDataSet =
dsData.GetChanges(DataRowState.Modified)
If dsChangedDataSet.HasChanges Then
HandleDataSetErrors(dsChangedDataSet)
Else
UpdateImagesInDB(dsChangedDataSet)
End If
End If
Catch ex As Exception
MessageBox.Show(ex.ToString)
End Try
End Sub
When I pass the imageDataSet object to the ProcessUpdates method, the
..HasChanges function will always return a false. If, however, I check
the .HasChanges function on the imageDataSet object before it is
passed, it will return a true value.
Ideas on this one?
Darian Bonnell
have two methods. The first on a form calls the second method which is
located in a class lib.
'Form Method
Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnSave.Click
'If imageDataSet.HasChanges Then
_databaseMethods.ProcessUpdates(imageDataSet)
'End If
End Sub
'Class Method
Public Sub ProcessUpdates(ByRef dsData As DataSet)
Try
If dsData.HasChanges(DataRowState.Modified) Then
Dim dsChangedDataSet As DataSet
dsChangedDataSet =
dsData.GetChanges(DataRowState.Modified)
If dsChangedDataSet.HasChanges Then
HandleDataSetErrors(dsChangedDataSet)
Else
UpdateImagesInDB(dsChangedDataSet)
End If
End If
Catch ex As Exception
MessageBox.Show(ex.ToString)
End Try
End Sub
When I pass the imageDataSet object to the ProcessUpdates method, the
..HasChanges function will always return a false. If, however, I check
the .HasChanges function on the imageDataSet object before it is
passed, it will return a true value.
Ideas on this one?
Darian Bonnell