Reputation:
The exception is throwed by database caused a conflicting by FOREIGN KEY.
Upvotes: 4
Views: 2714
Reputation: 1
if this is not helping use the grid view update method
If Not e.Exception Is Nothing Then
e.KeepInEditMode = True
e.ExceptionHandled = True
msg("error .", "a", Me.GetType(), ClientScript)
End If
Upvotes: 0
Reputation: 1249
To tell the ObjectDataSource to not rethrow your exception, you have to set the ExceptionHandled flag to True.
protected void MyOds_Updated(object sender, ObjectDataSourceStatusEventArgs e)
{
if (e.Exception != null)
{
//this tells the ObjectDatasource : It's ok, i'm taking care of this
//and don't rethrow it.
e.ExceptionHandled = true
// handle exception here (log/display to user etc ...)
}
}
I hope this will help you.
Manitra.
Upvotes: 3
Reputation: 41588
look at the eventargs on the ObjectDataSource. There should be an e.Exception & e.Results that you can query for the success/error of your update.
protected void MyOds_Updated(object sender, ObjectDataSourceStatusEventArgs e)
{
if (e.Exception != null)
{
// handle exception here.
}
}
Upvotes: 4