G
Guest
but I am trying to generate a DBConcurrenyException to at least put up a
warning message to the user if a database table has been changed by another
user before being updated by this user.
data table-for each new record inserted the web app increments column 1.
***********************
* int * varchar (20) *
***********************
* abc3 * ted *
***********************
* def4 * tom *
***********************
I am performing a record read and then closing the connection and then
later performing an Insert as shown below. I tried performing the read with
one machine, then with another performing the read and insert and then went
back to the first machine to perform the insert (this is where I would want
to generate the exception), but it does not.
read portion - I use a stored procedure with select, data adapter and dataset.
Me.da_orig.Fill(Me.Ds_orig1, "dml$get_originator")
Insert portion - am not using a dataset
Dim da_dataitmlog As New SqlDataAdapter 'instance of class sqlDataAdapter
Dim cmd_dataitmlog As New SqlCommand("stored procedure")
da_dataitmlog.InsertCommand = cmd_dataitmlog
try
cmd_dataitmlog.ExecuteNonQuery() 'Executes the stored procedure
Catch dbcEx As Data.DBConcurrencyException
some other code
end try
thanks.
warning message to the user if a database table has been changed by another
user before being updated by this user.
data table-for each new record inserted the web app increments column 1.
***********************
* int * varchar (20) *
***********************
* abc3 * ted *
***********************
* def4 * tom *
***********************
I am performing a record read and then closing the connection and then
later performing an Insert as shown below. I tried performing the read with
one machine, then with another performing the read and insert and then went
back to the first machine to perform the insert (this is where I would want
to generate the exception), but it does not.
read portion - I use a stored procedure with select, data adapter and dataset.
Me.da_orig.Fill(Me.Ds_orig1, "dml$get_originator")
Insert portion - am not using a dataset
Dim da_dataitmlog As New SqlDataAdapter 'instance of class sqlDataAdapter
Dim cmd_dataitmlog As New SqlCommand("stored procedure")
da_dataitmlog.InsertCommand = cmd_dataitmlog
try
cmd_dataitmlog.ExecuteNonQuery() 'Executes the stored procedure
Catch dbcEx As Data.DBConcurrencyException
some other code
end try
thanks.