473,405 Members | 2,373 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,405 software developers and data experts.

DBConcurrencyException not firing

Hi all,
I am using following code to update database; I am running two
instances of the application and updating the same record. However,
DBConcurrencyException doesn't fire. Is there something I am missing
in the code?

DataRow[] _err = null;
DataSet dsGetChanges = _nodeDataSet.GetChanges(DataRowState.Modified);

if (dsGetChanges != null)
{
SqlDataAdapter sqlDA = null;
try
{
sqlDA = _nodeDataAdapter;
sqlDA.ContinueUpdateOnError = true;
sqlDA.SelectCommand.Connection.Open();
sqlDA.Update(dsGetChanges);
if (dsGetChanges.HasErrors)
{
_err= dsGetChanges.Tables[0].GetErrors();
}
_nodeDataSet.Merge(dsGetChanges);
_nodeDataSet.AcceptChanges();
}
catch (DBConcurrencyException ex)
{
MessageBox.Show(ex.Message);
_nodeDataSet.RejectChanges();
}
finally {
_nodeDataAdapter.SelectCommand.Connection.Close();
_nodeDataAdapter.SelectCommand.Dispose();
}

Mar 29 '06 #1
1 1453
It might because of your line: sqlDA.ContinueUpdateOnError = true

As the name suggests it will continue prcoessing updates even if an
error is encountered during a row update. I guess this also includes
DBConcurrencyException

Mar 29 '06 #2

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

Similar topics

12
by: qaz | last post by:
For some reason my global.asa file is not firing. I have it located in the root of my website (e.g., wwwroot\mywebsite\global.asa) and I have the web site configured as an "application" in IIS. ...
2
by: 2G | last post by:
Hi, I seem to have some problems updating my dataset, I always get a error that no rows were updated...: An unhandled exception of type 'System.Data.DBConcurrencyException' occurred in...
0
by: Ram | last post by:
I have a start page for my application default.htm which contains four frames. header.htm login.aspx rightside.htm footer.htm login.aspx conatins username, password fields and login button....
0
by: Henrik de Jong | last post by:
Hello, I'm using radeditor. When I set the html-property to the text wich has to be altered, it gives me an error when try to save the new values of the html-proterty. It occurs only when i'm...
3
by: Mike | last post by:
Hi, I am adding controls dynamically in a WebForm, but none of these controls' events fire. Here is the class code I am using. I have tried so many things, but nothing works :-( namespace...
19
by: furiousmojo | last post by:
This is a strange problem. I have a project where the contents of global.asax application_error are not firing. It is an asp.net 2.0 application using web application projects. I have another...
3
by: Cub71 | last post by:
I am using Microsift Visual C# 2005 Express Edition and SQL Server 2005 Express Edition. I have created a few tables in the IDE. When I run my program in debug run the...
0
by: John | last post by:
Hi I am handling DBConcurrencyException for an adapter manager using code below. My problem is how to merge table in error with its copy from underlying database. If I need the table's data...
0
by: rote | last post by:
I have a TableDapter built from an Oracle Table. When i test for Concurrency by opening 2 sessions and edit the 2 at once the intial record record i update shows up and not the last one until i...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.