473,386 Members | 1,841 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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 http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #1
4 1799
CT
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
http://www.apress.com/book/bookDisplay.html?bID=105
"Kathy Burke" <ka**********@attbi.com> wrote in message
news:%2****************@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 http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 17 '05 #2
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 http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #3
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
www.dovetaildatabases.com

"Kathy Burke" <ka**********@attbi.com> wrote in message
news:%2****************@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 http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 17 '05 #4
CT
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
http://www.apress.com/book/bookDisplay.html?bID=105
"Kathy Burke" <ka**********@attbi.com> wrote in message
news:%2****************@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 http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Axle | last post by:
Hi, This has been giving me trouble for a while. I want to verify a URL (if it exists) with VB6, because sometimes the URL (my server) shuts down, so basically I just want it to ping a redirect...
0
by: Zap | last post by:
I'm having trouble verifying the cookie that I leave on a client's computer. Here is the code: <% Dim sPath, filesys, count, getValue, update, twohrs sPath =...
0
by: Support | last post by:
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"> <head>...
5
by: Mike Thomas | last post by:
In Access 2000, we are having a problem with some updates apparently not succeeding. I am not sure whether the records to be updated are locked, somebody is overwritng the changes, or what, but...
0
by: tamilan71 | last post by:
Can anyone tell me a simple method of creating an application in Access 2003 that uses "Double data entry"? For me double data entry is defined as the ability to have data entered twice. The first...
7
by: PC Datasheet | last post by:
Looking for suggestions ---- A database was designed for a national automobile inspection program. In it's simplest form, the database has two tables: TblOwner OwnerID <Year/Make/Model owned...
2
by: Cismail via SQLMonster.com | last post by:
Hi, Is there a simple way to verify if a database exists? I'm writing a stored procedure that will accept a database name as an input parameter, and create the database if it does't already...
3
by: jpr | last post by:
Hello, I have a form on which I have a cmdbutton to copy a couple of fields into another table (MASTER) using the SSN on the active form as criteria. In the active form (based on a tables...
1
by: rcamarda | last post by:
I have a database backup that our vendor proformed. I dont know if they verified the backup, nor do I have the disk space to create a new backup with verify or retore the current backup. Is...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.