G
gerry
My 1st crack at doing things the RAD way - I have a web form with a
SqlDataSource and a DetailsView.
I am trying to find a way to catch database exceptions so that i can display
an appropriate error message and let the user fix the data and resubmit the
form. ( In this case it is a dup key violation - so nothing I can pre-edit
for )
The only way I can see to catch db exceptions is by overriding Page.OnError
and looking at Context.Error. This gives me access to the exception and
Context.ClearError() stops the default error handling but by this point the
response has been cleared and so returns an empty page to the browser.
I am surprised that there isn't an OnError associated with either the
SqlDataSource or the DetailsView.
It almost looks like I am going to be forced to scrap the SqlDataSource and
go back to manual databinding etc in order to be able to catch db
exceptions.
I haven't found any references to this in google - so I assume that I am
missing something obvious.
Gerry
SqlDataSource and a DetailsView.
I am trying to find a way to catch database exceptions so that i can display
an appropriate error message and let the user fix the data and resubmit the
form. ( In this case it is a dup key violation - so nothing I can pre-edit
for )
The only way I can see to catch db exceptions is by overriding Page.OnError
and looking at Context.Error. This gives me access to the exception and
Context.ClearError() stops the default error handling but by this point the
response has been cleared and so returns an empty page to the browser.
I am surprised that there isn't an OnError associated with either the
SqlDataSource or the DetailsView.
It almost looks like I am going to be forced to scrap the SqlDataSource and
go back to manual databinding etc in order to be able to catch db
exceptions.
I haven't found any references to this in google - so I assume that I am
missing something obvious.
Gerry