Detailsview and Displaying Errors

  • Thread starter Thread starter JJ
  • Start date Start date
J

JJ

I have a detailsview that is used to update/insert records in my sql
database via a stored procedure.

The stored procedure returns a negative int when there is a problem - for
example a duplicate entry exists.

I can check for the return value in the objectdatasources 'OnInserted', and
I can display an error via a label control.

However, I'd like the detailsview fields to keep the erroneous entries so
the user can change them.
How can I achieve this?
Do I use viewstate?

Any pointers appreciated.
JJ
 
In the end I used a custom validator to check for a duplicated entry before
inserting the record.
This means two trips to the database, but unless someone can suggest another
method, that will have to do.

JJ
 
Back
Top