M
masmith
I am using VS 2008 to create a ASP.NET 3.5 web page with a third party grid
control and a SQLDataSource. I have found that adding events for the
SQLDataSource control to handle exceptions that occure during Insert or
Update does work. The problem is when I set the e.ExceptionHandled = true in
Inserted event, the SQLDataSource then fires an update. This is a problem as
the error is being caused by a duplicate key violation. Thus it is updating
the vaild or original row with the duplicate key value with the new insert
values.
I believe the problem is in the SQLDataSource control code as the Insert and
the Update are occuring in the same postback and the update fires as soon as
the insert is complete.
Has anyone else seen this behavior and found a solution?
control and a SQLDataSource. I have found that adding events for the
SQLDataSource control to handle exceptions that occure during Insert or
Update does work. The problem is when I set the e.ExceptionHandled = true in
Inserted event, the SQLDataSource then fires an update. This is a problem as
the error is being caused by a duplicate key violation. Thus it is updating
the vaild or original row with the duplicate key value with the new insert
values.
I believe the problem is in the SQLDataSource control code as the Insert and
the Update are occuring in the same postback and the update fires as soon as
the insert is complete.
Has anyone else seen this behavior and found a solution?