Error checking

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

JJ

What's best practise in this situation:

Upon submitting data input on a detailsview (bound to an objectdatasource),
I need to check for a duplicate email address (in an sql database) and
present the error message (if the email already exists) on the detailsview.

The data is strored in the sql table via a stored procedure which returns a
negative number without adding the record, in case of duplicate entries.

The question is:

How do I get the objectdatasource to tell me that the insert/update action
returned a negative value?
Can I display the error message and keep the inputted data in the
detailsview fields?

Is this the best way for me to inhibit duplicate entries?


Thanks,

JJ
 
I've managed to collect the returned negative value from the
objectdatasource using the OnInserted event.
My question no is how do I keep the values in the DetailsView to allow the
user to correct them?

When I refresh the page with the error message, the details view clears its
data.



JJ
 
Back
Top