Verify Database Update

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default Verify Database Update

    Hi, I asked this question last week, but still need some help.

    When I do an update to a database record (SQL Server), how would I do
    the code to verify that the update event has happened? I can't use
    transactions or stored procs in SQL Server. Is there a way to use vb in
    the asp.net sub procedure that would do this?

    Thanks.

    Kathy

    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Kathy Burke Guest

  2. Similar Questions and Discussions

    1. Use a CFC to update a database with a date
      Hi All, I am trying to input a date in a database field with the current date. The datefield is in one table and I only want the date to be inserted...
    2. update database
      I have a database where I need to input values that I calculate. I only need to do this once, so I wanted to write a template to do this quickly. I...
    3. Can a web service update a database ?
      Traditionally, examples of web service show them serving some data back to the clients. Can they update to a DB on the server too ?
    4. update from between database
      I have a Informix Database on Solaris and a SQL database. I need to update from Informix to SQL daily. Is there any easy way of doing it? BTW, I...
    5. Have website login form check a forum database to verify registration
      I need help with having a Login Form on a website that goes to a member only section, to beable to check my forum database so that when people...
  3. #2

    Default Re: Verify Database Update

    Would the RowUpdated event of the DataAdapter class be of any help to you?

    --
    Carsten Thomsen
    Enterprise Development with Visual Studio .NET, UML, and MSF
    [url]http://www.apress.com/book/bookDisplay.html?bID=105[/url]
    "Kathy Burke" <kathyburke40@attbi.com> wrote in message
    news:%23ps53i8VDHA.1832@TK2MSFTNGP09.phx.gbl...
    > Hi, I asked this question last week, but still need some help.
    >
    > When I do an update to a database record (SQL Server), how would I do
    > the code to verify that the update event has happened? I can't use
    > transactions or stored procs in SQL Server. Is there a way to use vb in
    > the asp.net sub procedure that would do this?
    >
    > Thanks.
    >
    > Kathy
    >
    > *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    > Don't just participate in USENET...get rewarded for it!

    CT Guest

  4. #3

    Default Re: Verify Database Update

    Since I'm only updating one record, it sounds good!

    I've never used it, could you possibly shoot me a code example of how to
    use it?

    Thanks!

    Kathy

    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Kathy Burke Guest

  5. #4

    Default Re: Verify Database Update

    If you use an instance of the SqlCommand class with the ExecuteNonQuery
    method, it will return the number of rows affected by the SQL or Stored Proc
    that executed. That would be good enough for me ... I suppose you could
    also simultaneously update a modified_dt column with the current time, and
    then confirm that the record now has the updated time, rather than the old
    time.

    Hope this helps.

    Mark
    [url]www.dovetaildatabases.com[/url]

    "Kathy Burke" <kathyburke40@attbi.com> wrote in message
    news:%23ps53i8VDHA.1832@TK2MSFTNGP09.phx.gbl...
    > Hi, I asked this question last week, but still need some help.
    >
    > When I do an update to a database record (SQL Server), how would I do
    > the code to verify that the update event has happened? I can't use
    > transactions or stored procs in SQL Server. Is there a way to use vb in
    > the asp.net sub procedure that would do this?
    >
    > Thanks.
    >
    > Kathy
    >
    > *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    > Don't just participate in USENET...get rewarded for it!

    Mark Guest

  6. #5

    Default Re: Verify Database Update

    Kathy,

    Well, here's a short VB example of how to set it up:

    Protected Shared Sub OnRowUpdated(ByVal sender As Object, ByVal e As
    SqlRowUpdatedEventArgs)
    ' In this procedure you can perform checks of what happened, i.e.
    ' did the updated work and if not, what went wrong.
    ' Check the properties of the passed instance of
    ' SqlRowUpdatedEventArgs (e). Please see the docs for
    ' more information.
    End Sub

    ......
    Dim MyDataAdapter As New SqlDataAdapter(...)

    ' Set up event handler
    AddHandler MyDataAdapter.RowUpdated AdressOf OnRowUpdated

    ......

    Now, the RowUpdated (after) event is commonly used in connection with the
    RowUpdating event (before), so do have a look at both in the docs. I hope
    this gets you going.

    --
    Carsten Thomsen
    Enterprise Development with Visual Studio .NET, UML, and MSF
    [url]http://www.apress.com/book/bookDisplay.html?bID=105[/url]
    "Kathy Burke" <kathyburke40@attbi.com> wrote in message
    news:%23Y54pz8VDHA.2352@TK2MSFTNGP12.phx.gbl...
    > Since I'm only updating one record, it sounds good!
    >
    > I've never used it, could you possibly shoot me a code example of how to
    > use it?
    >
    > Thanks!
    >
    > Kathy
    >
    > *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    > Don't just participate in USENET...get rewarded for it!

    CT Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139