can't catch DBConcurrencyException when using TableAdapter

R

rote

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,818
Latest member
Brigette36

Latest Threads

Top