Dealing with Record Contention by Limiting Changes: Listing 1

Private Function CheckForDifference(ByVal rw As System.Data.DataRow, _
    ByVal ingPosition As Integer) As Boolean

If IsDBNull(rw(ingPosition, System.Data.DataRowVersion.Original)) And _
    Not IsDBNull(rw(ingPosition, System.Data.DataRowVersion.Default)) Then
     Return True
ElseIf Not IsDBNull(rw(ingPosition, System.Data.DataRowVersion.Original)) And _
        IsDBNull(rw(ingPosition, System.Data.DataRowVersion.Default)) Then
     Return True
ElseIf IsDBNull(rw(ingPosition, System.Data.DataRowVersion.Original)) And _
        IsDBNull(rw(ingPosition, System.Data.DataRowVersion.Default)) Then
     Return False
ElseIf rw(ingPosition, System.Data.DataRowVersion.Original) <> _
        rw(ingPosition, System.Data.DataRowVersion.Default) Then
     Return True
Else
     Return False
End If

End Function
comments powered by Disqus
Upcoming Events

.NET Insight

Sign up for our newsletter.

I agree to this site's Privacy Policy.