Form / Dataset Changes

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mitchell Vincent

    #1

    Form / Dataset Changes

    I have the follow function for detecting when my bound dataset has
    changed (by the user, I hope).


    Public Function HasFormChanges( ) As Boolean

    Dim row As DataRow
    Dim i As Integer = 0

    For i = 0 To (Me.DataTable.R ows.Count - 1)

    row = Me.DataTable.Ro ws(i)

    Select Case row.RowState

    Case DataRowState.Ad ded
    Return True

    Case DataRowState.Mo dified
    Return True

    Case DataRowState.De leted
    Return True

    End Select

    Next

    Return False

    End Function


    However, now that I know *something* has changed, I'd like to know what.
    Is there any way for me to know what column header holds the value that
    is added, modified or deleted?

    --
    - Mitchell Vincent
    - kBilling - Invoices Made Easy!
    - http://www.k-billing.com
  • Cor Ligthert

    #2
    Re: Form / Dataset Changes

    Mitchell,

    With a lot of saving and using reject changes probably you can, however what
    it the reason you want this. Should you not tackle the user direct at the
    begin?

    Cor


    Comment

    • Peter Huang [MSFT]

      #3
      RE: Form / Dataset Changes

      Hi

      Have you tried to take a look at the DataTable event?
      DataTable.Colum nChanged Event
      http://msdn.microsoft.com/library/de...us/cpref/html/
      frlrfsystemdata datatableclassc olumnchangedtop ic.asp

      Working with DataTable Events
      http://msdn.microsoft.com/library/de...us/cpguide/htm
      l/cpconworkingwit hdatatableevent s.asp

      Is this what you want? If you still have any concern, please feel free to
      post here.

      Best regards,

      Peter Huang
      Microsoft Online Partner Support

      Get Secure! - www.microsoft.com/security
      This posting is provided "AS IS" with no warranties, and confers no rights.

      Comment

      • Mitchell Vincent

        #4
        Re: Form / Dataset Changes

        Cor Ligthert wrote:[color=blue]
        > Mitchell,
        >
        > With a lot of saving and using reject changes probably you can, however what
        > it the reason you want this. Should you not tackle the user direct at the
        > begin?
        >
        > Cor
        >
        >[/color]

        Actually, that function is returning changes as soon as the form is
        loaded and I have no idea why. I was going to see if I could find out
        *what* column was holding the changed data so I could track down where
        it is being changed and why.

        --
        - Mitchell Vincent
        - kBilling - Invoices Made Easy!
        - http://www.k-billing.com

        Comment

        • Mitchell Vincent

          #5
          Re: Form / Dataset Changes

          Peter Huang [MSFT] wrote:[color=blue]
          > Hi
          >
          > Have you tried to take a look at the DataTable event?[/color]

          Thanks Peter, that might work!

          --
          - Mitchell Vincent
          - kBilling - Invoices Made Easy!
          - http://www.k-billing.com

          Comment

          • Cor Ligthert

            #6
            Re: Form / Dataset Changes

            Mitchel,

            What happens when you load a dataset (table) is that there is as well a
            function that is default set to true.

            Acceptchanges during fill. I don't know when that is running.

            http://msdn.microsoft.com/library/de...gfilltopic.asp

            Cor


            Comment

            • Peter Huang [MSFT]

              #7
              Re: Form / Dataset Changes

              Hi

              You are welcome!

              Best regards,

              Peter Huang
              Microsoft Online Partner Support

              Get Secure! - www.microsoft.com/security
              This posting is provided "AS IS" with no warranties, and confers no rights.

              Comment

              Working...