Error checking

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
 
J

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
 

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

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,127
Latest member
CyberDefense
Top