Follow-up on how to log user who modify record.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nev
    Contributor
    • Oct 2007
    • 251

    Follow-up on how to log user who modify record.

    This is what I have figured out so far.

    dim user as string = "MyName"

    bindingsource.e ndedit()
    if dataset.haschan ges() then
    'How can I place "MyName" to every [Modified By] column for each record that was 'edited?
    tableadapter.up date(dataset.da tatable)
    end if

    Will be waiting for your very respectable reply. Thank you
  • dip_developer
    Recognized Expert Contributor
    • Aug 2006
    • 648

    #2
    Originally posted by nev
    This is what I have figured out so far.

    dim user as string = "MyName"

    bindingsource.e ndedit()
    if dataset.haschan ges() then
    'How can I place "MyName" to every [Modified By] column for each record that was 'edited?
    tableadapter.up date(dataset.da tatable)
    end if

    Will be waiting for your very respectable reply. Thank you
    create a table field something like "createdBy" and insert username on insert and update of records....what s problem????....

    Comment

    • nev
      Contributor
      • Oct 2007
      • 251

      #3
      Originally posted by dip_developer
      create a table field something like "createdBy" and insert username on insert and update of records....what s problem????....
      which object has the insert event or update event? i tried looking at the bindingsource events but it doesn't have those events. i can successfully log users who adds a new record by placing code in the addingnew event of the bindingsource. what i can't accomplish is how to log users who only modifies a record because i think there is no event for that in the bindingsource object.

      Comment

      • Shashi Sadasivan
        Recognized Expert Top Contributor
        • Aug 2007
        • 1435

        #4
        if the datattable has changes, then you have to scan each row and find if the rowstate is modified.
        If the row state is modified then edit the modified by column of that row to the username.

        Then update the table using the adapter (or depends on what you are using)

        Comment

        • nev
          Contributor
          • Oct 2007
          • 251

          #5
          Originally posted by Shashi Sadasivan
          if the datattable has changes, then you have to scan each row and find if the rowstate is modified.
          If the row state is modified then edit the modified by column of that row to the username.

          Then update the table using the adapter (or depends on what you are using)
          thank you, your wonderful suggestions has lead me closer to what i need to accomplish.

          Comment

          Working...