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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top