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
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