473,385 Members | 1,606 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,385 software developers and data experts.

can't catch DBConcurrencyException when using TableAdapter

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
refresh too see the new record.
But when i try doing this below to catch an excpetion no luck
protected void GridView1_RowUpdated(object sender, GridViewUpdatedEventArgs
e)

{

//It keeps returning -1
Response.Write(e.AffectedRows.ToString());
if (e.Exception != null && e.Exception.InnerException != null)

{

if (e.Exception.InnerException is DBConcurrencyException)

{

Label1.Visible = true;

e.ExceptionHandled = true;

}

}

}

What i understood is that AffectedRows need to return 0 for this to work
but mine keeps returning -1.
Any help
Jul 24 '08 #1
0 1091

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

Similar topics

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...
4
by: CaptRR | last post by:
I think this is the right group to post to, so here goes. My problem is this, I cannot update the datarow to save my life. Been on this for 2 days now, and still am no closer to figuring it out...
5
by: Programatix | last post by:
Hi, Have anyone ever benchmark the TableAdapter performance compared to DataTable's Load method? I found out that the DataTable's Load method is about 10x faster than TableAdapter's Fill method....
0
by: Manfred | last post by:
Hi all I just started with vb.net and try to use a tableadapter. I started with draging my Pubs DB tables on the form so the dataset was created automatically. After I added a query with...
1
by: niju | last post by:
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...
1
by: Tiago Vieira | last post by:
Hi everybody, I'm trying to insert a piece of javascript inside of a web service method but It's not working. Have somebody already tryed to do it? Folow a piece of my code below. ---------...
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: Tina | last post by:
Once I link up a .xsd tableadapter to an object data source to a gridview then put some template and button columns in the gridview I'm all set. works and looks great. But if I need to modify the...
7
by: John | last post by:
Hi I have below code which updates table tblClients and handles concurrency violation if needed. Is there a way to make the code generic so for example another table's name can be passed to the...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...

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.